spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column61


Introducing WML and WMLScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

A Crash Course in WML - Part III

The user agent can change cards by the <go> tag. This tag can call either a WMLScript function or move to another card of the WML deck. Clicking the Help option triggers a switch to card card1_help:

<do type="help" label="Help">
  <go href="#card1_help"/>
</do>

Clicking the Calculate option triggers a call to a WMLScript function called convert, defined in currency.wmls:

<do type="accept" label="Calculate">
  <go href="currency.wmls#convert('conversion','$(from)',
                                       '$(to)',$(amount))"/>
</do>

The second card of the deck, card1_help, demonstrates a few unique features. Here is the full definition:

<card id="card1_help" title="Help">
  <onevent type="onenterforward">
	<go href="currency.wmls#getInfoDate('date')"/>
  </onevent>
  <p>
  The currency rates were obtained from the Federal
  Reserve Bank of New York on $(date).
  <do type="prev" label="Back">
	<prev/>
  </do>
  </p>
</card>

We see again here the <go> tag, which calls the WMLScript function getInfodate(). This function loads the date variable with the date in the past on which the currency rates were obtained. It is invoked inside an onevent tag, with the event being entering the card, onenterforward.

The card itself includes two items. First is a free-text message, "The currency rates...." The second important item is the Back soft key. It is important to provide users with the key to go back from this Help card.

Next: How to program in WML - Part III

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


Created: May 8, 2000
Revised: May 8, 2000

URL: http://www.webreference.com/js/column61/6.html