WML <prev> Tag

Advertisements


The <prev> task represents the action of returning to the previously visited card on the history stack. When this action is performed, the top entry is removed from the history stack, and that card is displayed again, after any <setvar> variable assignments in the <prev> task have taken effect.

Attributes:

This element supports the following attributes:

AttributeValueDescription
classclass dataSets a class name for the element.
idelement IDA unique ID for the element.

Example:

Following is the example showing usage of <prev> element.

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">

<wml>

<card title="Prev Element">
<p>
   <anchor>
        Previous Page :<prev/>
   </anchor>
</p>
</card>
</wml>

One situation where it can be useful to include variables in a <prev> task is a login page, which prompts for a username and password. In some situations, you may want to clear out the password field when returning to the login card, forcing the user to reenter it. This can be done with a construct such as:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">

<wml>

<card title="Prev Element">
<p>
   <anchor>
        <prev>
           <setvar name="password" value=""/>
        </prev>
   </anchor>
</p>
</card>
</wml>



Advertisements
Advertisements