BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-13-2009, 06:34 AM   #1 (permalink)
New Member
 
Join Date: Mar 2009
Model: 7290
PIN: N/A
Carrier: airtel
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Smile Select all check boxes issue with Blackberry 9000 bold

Please Login to Remove!

Hi Friends,

We are working on one of the Blackberry requirements.

Brief description :
Developing browser based application for Blackberry 9000 bold
which involves the selection of multiple check boxes and select all check box(java scripti is enabled on the Blackberry browser)

when we select 'select all check box' is de selecting the already selected chckboxes (individual) and its selecting when we de select the 'select all check box' . This is cross checked on BB bold 9000 simulator (given by RIM).

Same is behaving fine with the 8800 simulator.

Any suggestion on usage of 'eval' method in javascript for Blackberry browser functionality.

Appreciate your quick response.

Thanks,
Sri.
Offline  
Old 03-16-2009, 04:51 AM   #2 (permalink)
New Member
 
Join Date: Mar 2009
Model: 7290
PIN: N/A
Carrier: airtel
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Friends,

Pls. let me know the solution for the above problem...it is very urgent for me...I am sick of this issue...
Offline  
Old 03-16-2009, 04:54 AM   #3 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

it might be helpful if you show us your code
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 03-17-2009, 04:51 AM   #4 (permalink)
New Member
 
Join Date: Mar 2009
Model: 7290
PIN: N/A
Carrier: airtel
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Pls. find the below code...!

for(i=0; i<frm.elements.length; i++)
{
var alertText = "called";
if(frm.elements[i].type == "checkbox"){
if(frm.elements[i].name!="chkSelectAll")
{
frm.elements[i].checked=frm.elements["chkSelectAll"].checked;
}
}
}
Offline  
Old 03-17-2009, 05:30 AM   #5 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

seems to work on the curve 8900. Maybe you could provide an url for testing or post the code of the form as well
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 03-17-2009, 11:39 PM   #6 (permalink)
New Member
 
Join Date: Mar 2009
Model: 7290
PIN: N/A
Carrier: airtel
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Ivanov,

I have tested this code on 8800 and 9000 Bold simulators. 8800 behaviour is as i expected and 9000bold behaviour is reverse of 8800.i am not sure whether Any configurations i need to change on the device or problem with 9000 bold itself.

pls. find the attached sample.txt file for sample code...

Thanks in Advance...
Sri
Attached Files
File Type: txt sample.txt (2.8 KB, 2 views)
Offline  
Old 03-18-2009, 04:39 AM   #7 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, I see what you mean. Could reproduce it on a Bold device. This is a bug for me. The state/value of the checkbox is set AFTER the onClick action is executed, that's why you get wrong value if you checks the state of the chkSelectAll checkbox.
It seems to be fixed in 4.6.1

you could use a global variable to save the state a an additional hidden field in your form.

here is the version with toggling the global variable:
Code:
<html>
<head>
<title>
check/uncheck all
</title>

</head>
<body>

<SCRIPT LANGUAGE="JavaScript">
    var allChecked = false;

    function chkAllFunc(frm)
    {
	allChecked = !allChecked;

       for(i=0; i<frm.elements.length; i++)
       {
           var alertText = "called";                
            if(frm.elements[i].type == "checkbox"){
                if(frm.elements[i].name!="chkSelectAll")
                {            
                    frm.elements[i].checked=allChecked; 
                }
              }
       }
       //alert(alertText)
   }
</script>



<form name="frmStatus">
    <input type="checkbox" name="list" value="1">1<br>
    <input type="checkbox" name="list" value="2">2<br>
    <input type="checkbox" name="list" value="3">3<br>
    <input type="checkbox" name="list" value="4">4<br>
    <input type="checkbox" name="list" value="5">5<br>
    <br>
    <input type="checkbox" name="chkSelectAll" value="Check All" onClick="chkAllFunc(this.form);"> All
    <br>
</form>
</body>
</html>
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)

Last edited by Ivanov : 03-18-2009 at 04:40 AM.
Offline  
Old 03-18-2009, 04:49 AM   #8 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

By the way, first I tried the following version below and it worked on the BOLD, but not on the new Curve with 4.6.1. Again a bug for me. There were and are a lot of bugs in RIM'S web/javascript engine. I remember the case on the old Pearl with 4.2.1 when all checkbox values in my form were ignored on POST and it took me days to find out that it was a bug of the browser and not my (complex) ASP code. It was then fixed in the next device software release...

Code:
<html>
<head>
<title>
check/uncheck all
</title>

</head>
<body>

<SCRIPT LANGUAGE="JavaScript">
    var allChecked = false;

    function chkAllFunc(list)
    {
	allChecked = !allChecked;

       for(i=0; i<list.length; i++)
       {
           var alertText = "called";                
           list[i].checked=allChecked; 
       }
       //alert(alertText)
   }
</script>



<form name="frmStatus">
<input type="checkbox" name="list" value="1">1<br>
<input type="checkbox" name="list" value="2">2<br>
<input type="checkbox" name="list" value="3">3<br>
<input type="checkbox" name="list" value="4">4<br>
<input type="checkbox" name="list" value="5">5<br>
<br>
<input type="checkbox" name="chkSelectAll" value="Check All"
onClick="chkAllFunc(this.form.list);"> All
<br>
</form>
</body>
</html>
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 03-20-2009, 01:49 AM   #9 (permalink)
New Member
 
Join Date: Mar 2009
Model: 7290
PIN: N/A
Carrier: airtel
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Hi Ivanov,

Thank you very much...this solution is working fine for me...!
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.