WML » Tags » refresh

Syntax:
<refresh> ... </refresh>

The refresh tag is used to update the current display. In other words, whatever card is currently being displayed will be refreshed.

This is referred to as a refresh task. A task is performed in response to an event. There are four tasks in WML: go, noop, prev, and refresh.
 
The refresh tag can only be nested inside an anchor, do, or onevent element.This tag can contain one or more setvar elements which are used to set new values for named variables.
 
Nested Tags:  setvar

Examples

Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>

<card id="card1" title="Card 1">
<p>
   Please click accept:
   <do type="accept">
      <go href="#card2">
         <setvar name="MyNumber" value="71" />
      </go>
   </do>
</p>
</card>

<card id="card2" title="Card 2">
<p>
   MyNumber = $MyNumber<br />
   <anchor>
      Refresh this page
      <refresh>
         <setvar name="MyNumber" value="348" />
      </refresh>
      </anchor>
</p>
</card>

</wml>
Explanation:

In this example, after the refresh anchor link is clicked, the variable named MyNumber changes from 71 to 348. In card2 the MyNumber variable is displayed using the dollar sign $ variable naming convention.

Language(s): WML

See Also: