WebCab.de: Jump back

Home: WAPstacles: Jump back

Jump back

You have reached a card after you have seen some other cards before. You want to jump back to the previous card. You activate the "Back" softkey in your WAP browser but nothing happens. The card contains the appropriate WML code with a do event and a prev task. So what can be the reason for this misbehaviour?

Have you ever seen the following WML code in a sample card of an SDK?

<card id="card1" title="Currency" newcontext="true">

If you set the attribute newcontext to true the browser context is cleared including the history stack. This means, that the user cannot jump back to the previous card or deck.

This attribute is often used to clear some variables which shall be set in the same card without preset values. If you want to solve the problem you can clear the variables which you want to use. Take the following WML code.

<card id="myID" title="Title">
  <onevent type="onenterforward">
    <refresh>
      <setvar name="some_var1" value=""/>
      <setvar name="some_var2" value=""/>
    </refresh>
  </onevent>
   ...
</card>

The following code shows a working example with the main code of the original deck.

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="World Wide Mobile Mail">
<onevent type="onenterforward">
<refresh>
<setvar name="ms" value=""/>
<setvar name="l" value=""/>
<setvar name="pw" value=""/>
</refresh>
</onevent>
<do type="prev" label="Back"><prev/></do>
<p><b>POP3 Mail Server: </b><input name="ms"/></p>
<p><b>Username: </b><input name="l"/></p>
<p><b>Password: </b><input name="pw"/></p>
<p><b>Menu: </b><select name="read">
<option value="Open">Open</option>
<option onpick="/s.wml">Services for users</option>
<option onpick="/i.wml">WebCab.de</option>
</select></p>
<p align="center"><anchor>Submit<go href="/cgi-bin/wwmm.cgi?n=1" method="post">
<postfield name="ms" value="$(ms)"/>
<postfield name="l" value="$(l)"/>
<postfield name="pw" value="$(pw)"/>
<postfield name="read" value="$(read)"/>
</go></anchor></p>
</card>
</wml>

[ < Prev ] [ Next > ]

© 2000-2017 WebCab.de TM, Contact