Software Sue

Link to Simply Sue
Link to Sustainability Sue
location: software/markup/wap/advanced Skip navigation : Home  

More advanced WAP


Beware compatibility problems. For more detail, see the design notes section.

Timers

The timer attribute is self closed. You can use it to redirect to another card after a set time.

  <card id="card1" title="WAP Card 1">
    <timer value="250"/>
     <p>
      Going to card 2 shortly
     </p>
   </card>

Different browsers might interpret the timer value as 2.5 or 250 seconds.

Images

Not all browsers can see images, so if you must use them, include the <alt> tag.

Images must be of type *.wbmp, and are 1 bit (black and white) only. Not all browsers can see images. To convert existing images, try http://www.teraflops.com/wbmp (does it online). To draw wbmp images, try http://www.hit-solutions.fi/wapdraw/.

To put a wbmp image on your wml page, use the following code:

<card>
  <p align='center'>
     <img src="wapimage.wbmp" width="30" height="20" alt=" My WAP Image"/>
  </p>
</card>

Forms

Forms are implemented using a do/go function within a go tag.

<do type="accept" label="Next">
    <go method="post" href="http://anyurl.com/cgiscript.cgi">
     <postfield name="searchvalue" value="$(mysearch)"/>
     <postfield name="type" value="general"/>
    </go>
</do>
  <p>
    Search for:
    <input type="text" name="mysearch"/>
  </p>

The dollar sign $ means a variable. In this case it returns the variable 'mysearch' which is returned by the input field below it.

Select Boxes

These allow users to select links or other operations from a drop down box.

<select init="0">
   <option onpick="http://www.link1.gov/">Link 1</option>
   <option onpick="http://www.link2.com/">Link 2</option>
   <option onpick="http://www.link3.org/">Link 3</option>
</select>

init means initial value. Set to the value of the link you want to be initially selected (e.g. 3 for link 3), or to 0 if you don't want an initial selection.

Variables

Variables store strings (alphanumerics) and are denoted by being preceded by a $ sign. Place the variable in brackets so the browser won't get confused, for example $(variable). Variables are valid for a whole deck, but do not persist outside that deck unless used as part of a form function.

Forms are the main item for which variables are used, for instance $(mysearch) is used in the forms example.

Another use for variables is to store that part of a URI which is common to several URI's in a list, for example:

<select name="forum">
    <option value="newsforum">NewsForum</option>
    <option value="ewcfor">European Community</option>
    <option value="crises">Global Crises</option>
</select>
<do type="accept" label="Go to forum..">
   <go href="go.compuserve.com/$(forum).wml"/>
</do>

The value="" attribute stores the selected forum name into name="", which is the variable $(forum).

To set a variable, use the setvar element, for example

<setvar name="Elton John" value="$(popstar)"/>

will store the string ' Elton John ' in variable '$(popstar)'.