Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Developer
kknuth
Posts: 19
Registered: ‎10-08-2008
My Device: Not Specified

Re: Blackberry browser support for AJAX

Can anyone from RIM comment on when the browser will fully support Javascript and AJAX?
Guru I
Xandrex
Posts: 18,406
Registered: ‎07-29-2008
My Device: Z30, Playbook, 9320BES
My Carrier: B&You _ SFR

Re: Blackberry browser support for AJAX

what is your question ?
today, no desktop browser fully supports Javascript, and even less AJAX.
Even Firefox or Opera.



The search box on top-right of this page is your true friend, and the public Knowledge Base too:
New Developer
kknuth
Posts: 19
Registered: ‎10-08-2008
My Device: Not Specified

Re: Blackberry browser support for AJAX

[ Edited ]
At a minimum I am asking that Blackberry support the implementation of Javascripting/AJAX as used by the Google Web Toolkit.  iPhone, gPhone, and Symbian all support this.  Blackberry does not.  Can RIM give guidance to web application developers as to when they will support this more robust set of Javascript functions?
Message Edited by kknuth on 10-13-2008 01:30 PM
New Developer
ttklf4
Posts: 43
Registered: ‎07-29-2008
My Device: Not Specified

Re: Blackberry browser support for AJAX

Hello,

 

I am not an expert of GWT but I have taken look at this toolkit and it seems that GWT has a client detection. This feature is typical for server based Ajax frameworks. Therefore it seems that the BlackBerry browser is unknown to GWT and the server of Googles sample page does not send the appropriate files to the client and the page is not displayed. Perhaps you will find more help in the documentation .

 

Hope it helps.

Guru I
Xandrex
Posts: 18,406
Registered: ‎07-29-2008
My Device: Z30, Playbook, 9320BES
My Carrier: B&You _ SFR

Re: Blackberry browser support for AJAX

apart from that client detection thing, RIM has never been part of the good browser vendors... even with the Bold.



The search box on top-right of this page is your true friend, and the public Knowledge Base too:
New Developer
mrbisson
Posts: 1
Registered: ‎02-19-2009
My Device: Not Specified

Re: Blackberry browser support for AJAX


TGreenwood wrote:

...
3. Outside of page load, neither document.write() nor innerHTML are producing any rendered changes in the net.rim.device.api.browser.field. However, at the end of page loading, or thereabouts, the net.rim.device.api.browser DOES render the results of these DOM changes. So, somehow net.rim.device.api.browser notices changes to the DOM and refreshes the page, whereas the browser.field impl doesn't have this check. 
...

So, the net.rim.device.api.browser is responding to the innerHTML and document.write() calls, but we're only seeing rendering at the end.

 

How could I get similar functionality with net.rim.device.api.browser.field?


 

I came across the same problem: changes are made to the innerHTML but are not reflected in browser.field. Is there any way around this? Are there any plans to fix this?

New Developer
javiergv
Posts: 50
Registered: ‎03-18-2009
My Device: 8530

Re: Blackberry browser support for AJAX

I am Developing an App for a forum, my Forum have a lot hide information with a label that in vBulletin is called post thank you, exactly after you press the button thank is when you can view the information hide. [HIDE-THANKS]Hide Information[/HIDE-THANKS]

 

The problem is that in the Mobile version of the forum I can´t give thank. I want to implement give thank from my app. The post thank you is in format Ajax.

Each post have a number, I dont know if it is possible that with the number of the post I can give the thank.

For example when I press the button Thank you, the url link is something like this: "zonablackberry.com.ve/forum/81xx/9227-crystal-clear-tema-para-81xx.html#post103826?thanks_mode=add"


 

 

In this case the number 103826 is the number of the post.

 

 

My idea is make a menu item

private MenuItem posthank = new MenuItem("Give Thank you", 0, 0) {

public void run()
{
String selections[] = {
"Done", "Cancel"
};
Dialog addDialog = new Dialog("Give Thank you", selections, null, 0, null);
EditField inputField = new EditField("Number of Post: ", "");
addDialog.add(inputField);
if(addDialog.doModal() == 0)
{
String text = inputField.getText();
String Post = "?thanks_mode=add";
String Pre = "zonablackberry.com.ve/forum/81xx/9227-crystal-clear-tema-para-81xx.html#post103826?thanks_mode=add";
Browser.getDefaultSession().displayPage(Pre + text + Post);
Browser.getDefaultSession().showBrowser();
}
}

};

 

 

But thanks are not added to the list. This could be that this mode is in format Ajax. Any idea to solve my problem?

Sorry for my poor English.

 

I´m from Venezuela.

// Code for getting Thanks
if( iWasHelpful && solvedYourProblem ) {
Thanks++;
solution = true;
}
Contributor
pkolenic
Posts: 12
Registered: ‎10-06-2010
My Device: Not Specified

Re: Blackberry browser support for AJAX

The problem with accessing a website built with Google Web Tools is in how Google Web Tools work. 

 

Basically you create the application using Java and then the GWT compiler creates multiple optimized JavaScript cached files.  It also creates a bootstrap file that is used to detect the browser and then it supplies the file optimized for that browser.

 

As previously suggested, the Blackberry browsers are not supplying a user agent string that the bootstrap file supports.

 

So one of two things (but preferably both) needs to happen. 

1) Blackberry changes the user agent string on that their browsers send

2) Google Web Tools provides a default cached file when it does not recognize the user agent.

 

As a way to verify that the GWT bootstrap is not supplying a default cache file, in Firefox you can change the user agent for testing.


www.lionbridge.com
Contributor
pkolenic
Posts: 12
Registered: ‎10-06-2010
My Device: Not Specified

Re: Blackberry browser support for AJAX

This is the section of the .nocache.js that determines which kind of browser is running the code and so which cache file to load.

 

  providers['user.agent'] = function(){
    var ua = navigator.userAgent.toLowerCase();
    var makeVersion = function(result){
      return parseInt(result[1]) * 1000 + parseInt(result[2]);
    }
    ;
    if (ua.indexOf('opera') != -1) {
      return 'opera';
    }
     else if (ua.indexOf('webkit') != -1) {
      return 'safari';
    }
     else if (ua.indexOf('msie') != -1) {
      if (document.documentMode >= 8) {
        return 'ie8';
      }
       else {
        var result_0 = /msie ([0-9]+)\.([0-9]+)/.exec(ua);
        if (result_0 && result_0.length == 3) {
          var v = makeVersion(result_0);
          if (v >= 6000) {
            return 'ie6';
          }
        }
      }
    }
     else if (ua.indexOf('gecko') != -1) {
      var result_0 = /rv:smileysad:[0-9]+)\.([0-9]+)/.exec(ua);
      if (result_0 && result_0.length == 3) {
        if (makeVersion(result_0) >= 1008)
          return 'gecko1_8';
      }
      return 'gecko';
    }
    return 'unknown';
  }
  ;
  values['user.agent'] = {gecko:0, gecko1_8:1, ie6:2, ie8:3, opera:4, safari:5};

 

Notice that if it does not determine a matching user agent it returns "unknown".  This is why it does not work on most Blackberry browsers as only the 9800 Torch has a browser that contains "gecko" in the user agent string,  the rest all return "blackberry".

 

So a solution until GWT creates an optimized cache file for Blackberry specific browsers could be to change the "return 'unknown'" to "return 'gecko'" or one of the other valid user agents (some testing would need to be done to find the one that is most compatible with the majority of blackberry browsers).


www.lionbridge.com