+ Start a Discussion
Edwin VijayEdwin Vijay 

Visualforce Page on Blackberry - javascript issue

Hi All,

 
I have got a visualforce page which has to be displayed on a blackberry. There is a javascript code on the visualforce page which shows/hides a div when a button is clicked. While i could see that the javascript function is called appropriately, the line "document.getElementById('sample').style.display = 'block';" does not seem to work. The blackberry version is 4.6.x, and the blackberry developer documentation states that the above line of code is supported in versions 4.6 and above.
 
Below are some other options i tried,
 
  • Tried using visibility:hidden. It doesn't work as well.
  • Tried document.getElementById('sample').setAttribute("style","display:block;"). Doesn't work.

Any help is much appreciated.

 
Thanks,
Edwin
Best Answer chosen by Edwin Vijay
Edwin VijayEdwin Vijay

I have an update on this..  This issue has been driving me nuts, i hope to find a solution soon

 

 

I created a force.com site, linked my site with the visualforce page. I then ran the Blackberry Simulator, opened the Blackberry Browser and pointed to my force.com site. The javascript code is now working.....

 

 

The same visualforce page when added to a "Visualforce tab", and opened from the "Salesforce Mobile"  application on the blackberry ... the javascript code does not work now... 

 

 

All Answers

WizradWizrad

Try using $Component and/or giving it the full id

Edwin VijayEdwin Vijay

But i use a normal div tag, so i believe i can't use the $Component notation.

 

Also, the code works on an ordinary browser. It does not work only when viewed in the blackberry, and that too that single line of code doesn't seem to make any change.

 

Edwin VijayEdwin Vijay

I have an update on this..  This issue has been driving me nuts, i hope to find a solution soon

 

 

I created a force.com site, linked my site with the visualforce page. I then ran the Blackberry Simulator, opened the Blackberry Browser and pointed to my force.com site. The javascript code is now working.....

 

 

The same visualforce page when added to a "Visualforce tab", and opened from the "Salesforce Mobile"  application on the blackberry ... the javascript code does not work now... 

 

 

This was selected as the best answer