×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    23

    BACK to opening WRT page after using redirect

    How do I get BACK to the opening index.html page after redirect to a remote URL with function initRedirect()?

    With code below I can associate an "Exit" right soft key while displaying the remote URL and I like that.

    Now I want to associate "Back" using the left soft key so I can go back to the opening WRT index.html.

    code portion from the WRT index.html

    <script language="javascript" type="text/javascript" src="basic.js"></script>
    <body onLoad="javascript:init();">
    <div id="logo" align="center"><img src="images/info.png" alt="Hollywood-USA" border="2" /></div>
    <div id="east" align="center"><a href="http://www.hollywood-usa.mobi/tocEAST.php">EAST</a></div>
    <div id="south" align="center"><a href="http://www.hollywood-usa.mobi/tocSOUTH.php">SOUTH</a></div>
    <div id="midwest" align="center"><a href="http://www.hollywood-usa.mobi/tocMIDWEST.php">MIDWEST</a></div>
    <div id="west" align="center"><a href="http://www.hollywood-usa.mobi/tocWEST.php">WEST</a></div>
    <div id="news" align="center"><a href="http://www.hollywood-usa.mobi/news.php">Showbiz News</a></div>
    </body>

    code from the basic.js

    function init() {
    // show soft keys
    window.menu.showSoftkeys();
    // set right softkey to "exit"
    if (window.widget) {
    menu.setRightSoftkeyLabel("", null);
    }
    //
    document.getElementById('east').onclick = initRedirect;
    document.getElementById('south').onclick = initRedirect;
    document.getElementById('midwest').onclick = initRedirect;
    document.getElementById('west').onclick = initRedirect;
    document.getElementById('news').onclick = initRedirect;
    /*
    // create UI manager
    uiManager = new UIManager();
    }

    // redirects nicely to show remote URL page + visible/functional "Exit" with right soft key
    function initRedirect() {
    // show soft keys
    window.menu.showSoftkeys();
    // set right softkey to "exit"
    if (window.widget) {
    menu.setRightSoftkeyLabel("", null);
    }
    self.location.href=url;
    }

    Cheers.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: BACK to opening WRT page after using redirect

    Hi captain_dixie,

    as from my experience, once you load another HTML page inside the widget container, you actually exit from the widget's environment. So, even if you manage to get back to the original index.html page, your widget will most probably not work.

    Anyway, some tests in this sense could be worth.

    Pit

  3. #3
    Registered User
    Join Date
    Apr 2004
    Posts
    23

    Re: BACK to opening WRT page after using redirect

    Hi Pit,

    I think you are correct. However, the right soft key still seems to be within the WRT environment as the right soft key with 'Exit' label so sweetly provides a useful exit. However, I think I recall the exit is still there using the right soft key even if there is no label to say so. So I looking for a trick to use the left soft key to relaunch the WRT if I can not use it to give me a relative 'Back'. I'm re-learning java script slowly and something may stir my cranium to solution. If I find it I will post it here.

    I am also exploring a few Plan B options.

    Ciao
    Steve

  4. #4
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    103

    Re: BACK to opening WRT page after using redirect

    hello captain_dixie

    plz tell me your problem clearly. May be possible i solve it. Because i faced that problem my application also.



    Tarun(TJ)

  5. #5
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    53

    Re: BACK to opening WRT page after using redirect

    I have the same problem and can't slove it.
    I try to using a preferenceForKey to store the path(window.location.href) of the WRT page(original index.html), after redirecting to another website, using window.location = path to set, but nothing happened.
    It seems that the wrt browser treating the local html file and remote website file in different ways.
    M-Sharp(M#)
    http://msharp.blog.35.com

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: BACK to opening WRT page after using redirect

    Hi forumz,

    if you want to allow your users to get back to your widget after visiting a remote website, the current best option seems to be to open the phone's Web browser. Once the user exits from the Web browser, it will see your widget again in foreground.

    Not perfect, but it works

    Pit

Similar Threads

  1. Redirect to WML page after JAR has been sucessfully downloaded
    By vskjefst in forum Mobile Java General
    Replies: 1
    Last Post: 2003-10-22, 14:49
  2. back button problem
    By wenyancam in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2002-12-04, 16:09

Posting Permissions

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