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
Posts: 22
Registered: ‎08-28-2008
My Device: Not Specified

Re: innerHTML element attribute is not supported in the Blackberry browser.

Thanks Xandrex,

 

BES is not part of the picture.  We are targeting the iPhone (fairly simple to develop for), Windows Mobile (the cause for our need to support the innerHTML attribute as it will not support W3C standards until next year) and the Blackberry.  In this case market share dictates ignoring the Blackberry devices for this and following products unless we can get something worked out.

 

I really hope Blackberry will help out.  If you don't think opening a support ticket would work is there another avenue to make the request to help get a reasonable answer? Is there a developer technical support support ticket separate from the "I can't turn on my phone" support ticket chain?

 

Matt

 

BlackBerry Development Advisor
Posts: 15,806
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: innerHTML element attribute is not supported in the Blackberry browser.

This is a a new feature that was added to the BlackBerry Browser in version 4.6.0 of BlackBerry handheld software.  Patches are not released for BlackBerry handheld software, fixes and new features are implemented in newer releases.

 

Alternativly, you could detect that a web user is using a version of the BlackBerry Browser that does not support innerHTML and provide an alternative page.  The following link explains how this can be done.

 

How To - Retrieve information about the BlackBerry Browser
Article Number: DB-00435

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800878/800733/How_To_...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
New Developer
Posts: 22
Registered: ‎08-28-2008
My Device: Not Specified

Re: innerHTML element attribute is not supported in the Blackberry browser.

[ Edited ]

Thanks Mark,

 

Support for innerHTML would be nice.  Another solution would be a resolution to the bug with createTextNode() in the 4.2 browser.  I have tried and can't find documentation on the fix to this which I was told was released in the 4.3 browser (I have not confirmed this yet).


We have an application that needs to use Javascript to update text on the screen in real time.  I have spent considerable time exploring four approaches to accomplishing this:

 

Update the element's innerHTML property

  Not supported until 4.6, upgrading the browser on client phones is not an option.

Use createTextNode() to replace the node

  Not working under 4.2 as far as I can tell.

Reload the page from the server

  Not useful as the phone may be offline at the time.  This is for a long running application.

Use document.write() to update the page

  Will not work as it would reset the javascript engine.

 

Other than these four approaches is there another solution I have not thought of?

 

Can you confirm what the problem is with createTextNode() under 4.2 and let me know if a work-around exists?  I am not even sure what the problem is, I just can't get it to work and can't find documentation (like a release note of 4.3 with a fix note detailing the problem).  If I knew more about what the problem was there may be a way to code around it.

 

Thanks in advance for your help, this is an important matter for our company.

 

Matt

 

Message Edited by dvdmatt on 09-09-2008 03:40 PM
BlackBerry Development Advisor
Posts: 15,806
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: innerHTML element attribute is not supported in the Blackberry browser.

The createNode method is not supported in the version 4.2.0 BlackBerry Browser.

 

You could make use of a combination of these solutions.  You could detect the browser version and use createNode for BlackBerry Browser versions 4.3.0 and higher.  Prior releases may require a server side refresh of the page to update your content.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
New Developer
Posts: 22
Registered: ‎08-28-2008
My Device: Not Specified

Re: innerHTML element attribute is not supported in the Blackberry browser.

[ Edited ]

Thanks Mark,

 

I am still having trouble working with the Blackberry.  Can you confirm if the following functions are supported in 4.2?

 

appendChild()

cloneNode()

TreeWalker()

NodeIterator()

 

The first is fairly basic, I would assume it should be there?

 

Matt

 

Message Edited by dvdmatt on 09-16-2008 11:31 AM
New Developer
Posts: 6
Registered: ‎09-15-2008
My Device: Not Specified

Re: innerHTML element attribute is not supported in the Blackberry browser.

It so happens I'm trying to do some javascript updating.

 

What we have resorted to is using only the field controls, the textbox, the button, and "maybe" the textarea.

 

You can use the .value of these to update their contents.  Believe, I know it's not the same as innerhtml.  But it's what is there.

 

What is frustrating me, is that textarea used to work in older blackberries for being updatable, but now it appears in the newer models, like the 8830, this has been taken away.  I don't get why we get less going forward, but I'm trying things out device by device.

 

So there is a work around the innerhtml problem - dont' use table cells - I'm guessing that is what your'e doing.

 

Have an ugly step child version of the forms you're doing, and only use the form elements for updating.

 

Unfortionately it appears that supporting a multi-line updatable field isn't practicle with the 88xx series devices out there where this was taken away.

BlackBerry Development Advisor
Posts: 15,806
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: innerHTML element attribute is not supported in the Blackberry browser.


dvdmatt wrote:

Thanks Mark,

 

I am still having trouble working with the Blackberry.  Can you confirm if the following functions are supported in 4.2?

 

appendChild()

cloneNode()

TreeWalker()

NodeIterator()

 

The first is fairly basic, I would assume it should be there?

 

Matt

 

Message Edited by dvdmatt on 09-16-2008 11:31 AM

 

Please refer to the JavaScript Appendix of the BlackBerry Browser - Content Developer Guide at the URL found below.  Supported JavaScript methods are listed in that section.

 

http://na.blackberry.com/eng/support/docs/subcategories/?userType=21&category=BlackBerry+Browser&sub...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
New Developer
Posts: 22
Registered: ‎08-28-2008
My Device: Not Specified

Re: innerHTML element attribute is not supported in the Blackberry browser.

[ Edited ]

Thanks again Mark,

 

The first two Methods I am asking about work on DOM objects.  I did look in the documentation you reference before posting here and didn't see a section on objects.  The following sections were listed:

  Blackberry, BlackBerry Location, Navigato, Document, Form, Screen, Window, Window History.

I was also tried searching the document but was not able to find references to these routines.  The first (appendChild()) is quite a basic function and I was surprised that it didn't work, and again to not be able to find mention of it in the documentation.

 

The second pair are Methods of the Document object.  I found them mentioned in the international specs, but they were also not covered in the 4.2 documentation.  I was hoping that you could help unearth their status for me.

 

Oh, the second two are more properly 'document.CreateNodeIterator()' and 'document.createTreeWalker()'.  I noted that the capitalization of these is not consitent with the standards, but this is how they are listed in my references.

 

Thanks again for your help,

 

Matt

 

Message Edited by dvdmatt on 09-18-2008 05:11 PM
Message Edited by dvdmatt on 09-18-2008 05:12 PM
Highlighted
New Developer
Posts: 22
Registered: ‎08-28-2008
My Device: Not Specified

Re: innerHTML element attribute is not supported in the Blackberry browser.

Hi HuskerSam,

 

Thanks for your suggestion, this looks promising.

 

I played around with it a little today and have a couple of questions.  Fist I assume by 'field controls, the textbox' you are referring to using the <input> widget in a <form>.  If this assumption is incorrect please ignore my questions below.

 

Using an <input type="text"> widget do you know of a way to hide the border to get this to mimic a TextNode?  The style.border affects a border around the input's black border, not the black border itself.

 

I also tried setting the readonly attribute of the <input> widget and though this does not color the background on some browsers it does seem to do so on the BlackBerry 4.2.2 browser.  I tried using style to change the background back to noavail.

 

You mention not to use table cells.  I started out just using '<tag style="top: 0px; left: 0px; position: absolute;">, but found it did not play well with MS's broken browser on the Windows Mobile platform so I abandoned it in favor of using tables.  What problems have you run across using tables?

 

Thanks for any other thoughts or suggestions.

 

Matt