×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Nokia Developer Expert
    Join Date
    Apr 2008
    Location
    Washington, DC USA
    Posts
    12

    Differences between simulator and device (mwl.switchClass)

    I'm writing a simple web app based on the Single Scene template in the tools. The app UI consists of two screens, using mwl.switchClass to go from one to the other.
    In the simulator, the transitions work fine. On the device (Nokia X3-02 with latest browser from browser.ovi.com), the transition from home screen to the second screen does not happen when I press the button assigned to the transition. When I press the home button (using the original code from the template), the UI switches to the second screen and then immediately back to the home screen.

    The only problem I can think of is that I'm mixing mwl calls and DOM search (document.getElementById('stop_id').value) in the same place.

    Here's the relevant code from index.html

    Code:
            <div id="stage">
                <table id="slider" class="show_toc" cellspacing="0" cellpadding="0" border="0" summary="Slider Table">
                    <tr>
                        <td>
                            <div class="item_container" id="toc">
    	                        <h2>Enter bus stop ID</h2>
    	                        <p><input type="text" id="stop_id" value="1001490" /></p>
    				<p>
    					<img id="get_bus" src="img/go_button.png" onclick="mwl.switchClass('#slider', 'show_toc', 'show_scratchpad'); 
    					mwl.insertHTML('#subtitle', 'Next bus at stop ID ' + document.getElementById('stop_id').value);
    					getAction1(document.getElementById('stop_id').value);" alt="" />
    				</p>
                            </div>
                        </td>
                        <td>
                            <div id="subtitle">Hello</div>
                            <div id="scratchpad_ctr">
    			<h2 id="scratchpad">Loading...</h2>
    			<div id="bus_error"></div>
    			<img id="refresh_img" src="img/refresh.png" 
    				onclick="getAction1(document.getElementById('stop_id').value);" alt="" />
    			</div>
                        </td>
                    </tr>
                </table>
            </div>
    --Oren Levine
    Web developer portfolio manager, Nokia
    oren.levine@nokia.com

  2. #2
    Registered User
    Join Date
    Feb 2011
    Posts
    45

    Re: Differences between simulator and device (mwl.switchClass)

    I believe there's bug in document.getElementById() not being run by device. I encountered this issue few weeks ago and no resolution yet, from Nokia T_T. If you find another solution, please share with us.

  3. #3
    Nokia Developer Expert
    Join Date
    Apr 2008
    Location
    Washington, DC USA
    Posts
    12

    Re: Differences between simulator and device (mwl.switchClass)

    I fixed the problem in my app by moving the DOM queries (document.getElementById()) to a separate JavaScript function. Now I get the page transition on simulator and device, followed by a short delay while the JS executes on the server.
    That's OK, though. At least the app now works the same way on the simulator and the device.
    --Oren Levine
    Web developer portfolio manager, Nokia
    oren.levine@nokia.com

Similar Threads

  1. Replies: 1
    Last Post: 2005-12-28, 06:56
  2. Differences between emulator and device
    By djgtram in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-02-20, 14:20
  3. Differences between 6.1 and 7.0s
    By csymbian in forum Symbian
    Replies: 1
    Last Post: 2004-04-29, 06:36

Posting Permissions

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