Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    34

    Back button like "window.history.back()" + Detect Display Language

    Hello everybody i have two questions.

    1) As I understand widgets can have only one html page. So, we can not have more than one pages in a widget, and we use HTML DOM instead, which means we can not use window.history.back() functionality of js. Tell me if I am right or wrong.

    I want to let the user push a button and return to the previous state of the application. How can i store the states of the widget so that i can create a back button.

    2)I want detect the display language of the device. I found the following:

    <embed type="application/x-systeminfo-widget" hidden="yes"></embed>
    and
    var lang = document.embeds[0].language.toString();

    but this gives a warning in WDE, and when i used that code, a Nokia RDA device gave a system error.

    So I want to know if there is another way to detect the display language,

    Thanks,
    Onur

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: Back button like "window.history.back()" + Detect Display Language

    Hi Onur,

    1) You are right about history.back() not being useful in Symbian WRT.
    Storing the state depends on what kind of navigation stack you will be using and what data you want to preserve. If you have a simple text input and you end up switching between pages by only hiding the previous page and showing the next one, browser automatically preserves the user input. On the other hand if you replace the page contents with new one, you would have to get the data from the old page prior to switching and store it with setPreferenceForKey() .

    2)
    If you are trying to detect the language for localization purposes, the platform itself offers built in way to do localization.
    http://www.developer.nokia.com/Resou...languages.html

    Br,
    Ilkka

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    34

    Re: Back button like "window.history.back()" + Detect Display Language

    Thank you for response Ilkka, after your reply i have the following questions.

    Quote Originally Posted by isalento View Post
    browser automatically preserves the user input
    how can i reach that preserved user input?

    Quote Originally Posted by isalento View Post
    you would have to get the data from the old page prior to switching and store it with setPreferenceForKey() .
    so i have to write inverse functions to undo what user has done?

    i'll give a look at it, thank you.

  4. #4
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: Back button like "window.history.back()" + Detect Display Language

    Quote Originally Posted by fonurr View Post
    Thank you for response Ilkka, after your reply i have the following questions.

    how can i reach that preserved user input?
    The browser doesn't explicitly store the text, rather it just does not empty the input field values when a element containing the input field is hidden. So the way to access it is just
    Code:
    document.getElementById("inputid").value
    so i have to write inverse functions to undo what user has done?
    Yes, you would have to manually read values of input fields, states of any toggle buttons etc.., that is IF you completely remove the last page from the DOM. If you just hide it by setting el.style.display = "none"; DOM state is preserved and so are the possible changes made by the user. That will save a lot of work.

    Br,
    Ilkka

Similar Threads

  1. Unable to use a "back" button
    By marc_garraway in forum Mobile Java General
    Replies: 5
    Last Post: 2008-11-06, 10:04
  2. how to replace the "back" button with the menu?
    By yinjialiang in forum Symbian User Interface
    Replies: 9
    Last Post: 2003-10-28, 07:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×