04-25-2012 11:38 AM
04-25-2012 12:34 PM
"A good option seemed to rely on a singleton instance of the ContentPage and just reset its content with new content. "
I agree, and so I am surprised that this did not work.
"But on OS6 and OS7 Smartphone the Browserfield just stays blank on its second invocation."
Can you describe how you do this 'second invocation', in other what you do to the BrowserField after it has correctly displayed its first page.
Do you supply the content 'on device', or does it go to some web service for the content?
04-25-2012 02:21 PM
The content is retrieved from a webservice but is passed as on device, i.e. displayContent is called on the BrowserField with an HTML string. So it can be viewed as local content.
I tried the invaction on several options but the result is the same. One of the options is:
The ContentPage has a setContent method that is invoked, in which the article is set to be displayed. The contentPage is then pushed to be displayed. Updating the content of the BrowserField can be executed in the setContent or onUiEngineAttached, with equal result.
In the first invocation, i.e. the first time the setContent method is executed and the content of the BrowserField is set, all goes well. The second time the BrowserField fails to do so.
I tried severial options to provide the singleton instance including: a singleton construction on the ContentPage class (static member with getInstance function) and provinding the ContentPage from the UiApplication. Besides that I tried to have a static instance of the BrowserField and rebuild the ContentPage with the same BrowserField at each instance.
The screen stack is rebuild to support singelton instance of the ContentPage.
04-26-2012 02:44 AM
Well I do,
* I update the content (displayContent() )
* Push the Screen
(I tried it also in reversed order, by invoking the displayContent in the onUiEngineAttached and also in the onFocus)
04-26-2012 04:11 AM
I had assumed that the screen was already 'pushed' in other words, the BrowserFild was already on display, just with the old content. So I thought you updated the content only.
04-26-2012 04:17 AM - edited 04-26-2012 04:18 AM
Sorry for the confusion, but both scenarios happen. The user can navigate through articles with navigation buttons or swiping, after which the content in the browserfield is correctly update. These actions are all handled within the same screen, and work as should.
The problems occur when the screen is pushed back on the stack, after it has been popped to show aother page listing article titles.
04-26-2012 04:38 AM
When you are drilling down articles in this way, the usual practice is to push the screen that contains the new article, then pop this screen when the user returns. In this way the original screen is left underneath and is not touched during the process. Would this work?
09-24-2012 07:56 AM - edited 09-24-2012 08:02 AM
I'm having a similar issue with the browserfield:
i'm having a screen which contains a browserfield. When i first push the screen, i load some webpage into the browserfield using BrowserField.requestContent(URL). The webpage displays correctly inside the browserfield.
If i pop the screen and push it back, the contents of the browserfield remain blank. Even a new BrowserField.requestContent(URL) does not fix the issue. Any idea why?
The only way i found to overcome this situation is to create a new browserfield on every screen push and reload the webpage, which, imo, is not a solution. Not
I'm having the bb bold 9790 with os 7.0 Bundle 2254
Any hints? Thanks.