BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 03-13-2009, 06:34 AM   #1
srihari83
New Member
 
Join Date: Mar 2009
Model: 7290
PIN: N/A
Carrier: airtel
Posts: 7
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
srihari83
New Member
 
Join Date: Mar 2009
Model: 7290
PIN: N/A
Carrier: airtel
Posts: 7
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
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
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
srihari83
New Member
 
Join Date: Mar 2009
Model: 7290
PIN: N/A
Carrier: airtel
Posts: 7
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
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
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
srihari83
New Member
 
Join Date: Mar 2009
Model: 7290
PIN: N/A
Carrier: airtel
Posts: 7
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
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
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
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
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
srihari83
New Member
 
Join Date: Mar 2009
Model: 7290
PIN: N/A
Carrier: airtel
Posts: 7
Smile

Hi Ivanov,

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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Bunn Ultra-2 Main Control Board FACTORY NEW 44039.1000 38710.1000  - 013 picture

Bunn Ultra-2 Main Control Board FACTORY NEW 44039.1000 38710.1000 - 013

$180.00



1PCS New In Box  ABB Inverter Memory Card  N2000 ACS880-MU-ZCU-12/14 ZMU-02  picture

1PCS New In Box ABB Inverter Memory Card N2000 ACS880-MU-ZCU-12/14 ZMU-02

$68.69



Msr X6 Swipe Card Reader Writer 3-Track Usb Msrx6 Compatible W/ Msr206 Msr605x M picture

Msr X6 Swipe Card Reader Writer 3-Track Usb Msrx6 Compatible W/ Msr206 Msr605x M

$159.99



2711-NM15 BRAND NEW AB Memory Card 2711 NM15  1PCS picture

2711-NM15 BRAND NEW AB Memory Card 2711 NM15 1PCS

$382.30



New Sealed AB 2080-MEMBAK-RTC Memory Backup, Data Log, Recipe ,High Accuracy RTC picture

New Sealed AB 2080-MEMBAK-RTC Memory Backup, Data Log, Recipe ,High Accuracy RTC

$286.59



WiFi Audio Voice Recorder Audio Alerts Check Audio Real-Time 32GB USA Shipper picture

WiFi Audio Voice Recorder Audio Alerts Check Audio Real-Time 32GB USA Shipper

$129.00







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