spacer

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

home / experts / javascript / column61


Introducing WML and WMLScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


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

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