×

Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Nokia Developer Expert
    Join Date
    Oct 2011
    Posts
    2

    Multiple pages (or scenes) for a webapp

    Just wanted to share something very basic about S40 webapp development that I learnt recently, and would have saved me a lot of time had this fact been made very clear in the documentation pdfs available.

    If you are intending to have multiple scenes / views / pages for your webapp, creating separate html pages and loading them using mwl.loadURL() is _not_ the way to go about it. The widget modeled web app architecture does not allow for this (as far as I know - I encountered some major rendering issues with the pages other than index.html).

    So how does one add multiple views/pages? Well, you put all the html content for each view in its own container (div mostly), and then hide or make it visible as and when necessary. Basically, there will only be one html file, and that is the index.html file, and the javascript file will handle events based on which it decides which container nodes to show and which ones to hide to create a different view.

    I have found that simply adding a couple of classes like the ones below and applying them to the divs you want to show/hide help with this task immensely:

    .hidden {
    display: none;
    }

    .visible {
    display: block;
    }

    Just hiding a container node (eg. div) instead of removing that node allows for faster access of the div's content in the future (if done during the same browsing session) without having to re-request the content and rendering methods from the server-side.

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

    Re: Multiple pages (or scenes) for a webapp

    Thank you for sharing your experiences.

    Indeed it could be stated somewhere that use of separate HTML pages is discouraged. At the moment correct web app model is mostly documented via code examples.
    http://www.developer.nokia.com/Devel...Code_examples/

    Br,
    Ilkka

Similar Threads

  1. Opening multiple QML pages from Cpp?
    By _perza in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-10-03, 15:45
  2. Multiple pages in QStackedWidget
    By yannifan in forum Qt
    Replies: 3
    Last Post: 2011-03-14, 14:55
  3. Anybody knows when will nokia 5800 get new homescreen with multiple pages
    By ramesh5180 in forum General Development Questions
    Replies: 4
    Last Post: 2010-05-12, 19:10
  4. Soft keys for multiple pages
    By nithyas in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2008-08-08, 13:12
  5. Problem of multiple pages
    By chheang in forum Symbian
    Replies: 1
    Last Post: 2002-09-04, 07:25

Posting Permissions

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