Won Contests Let Us Talk Mail Me Light of Knowledge


W ML - Wireless Markup Language
  
 Building Mobile Applications using WAP & Wireless Programming


Jumping WML Pages using GO Task

Here u will be moving from one WML File to Another using GO Button of WML , This is Similar to Aref Tag of our welknown HTML

 
 The GO task represents the action of switching to a new card
The code below shows How to use GO Tasks
page1.wml
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>
<card>
<p>
 <anchor>
  Go To Page2
  <go href="page2.wml"/>
 </anchor>
</p>
</card> 
</wml>
page2.wml
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>
<card>
<p>
 <anchor>
  Go To Page1
  <prev/>
 </anchor>
</p>
</card> 
</wml> 
 Running the code
1) save the above file as page1.wml, page2.wml in E:\wml\ Directory
2) Open UPSDK Browser, which will be a shortcut created during installation
3) Type in the URL file://e:/wml/page1.wml next to GO Button Text Box, Hit Enter ..........
4) Always remember whenever u make changes to the wml script, u must click on Edit Clear Cache to View New Screen and Re-Enter URL
 Using Refresh Command
Some times it may be required that u need to Refresh a WML file on the Client without actually clearing cache, Best Example is Online Mobile Stock Updates......
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>
<card>
<p>
 <anchor>
  Refresh this
  <go href="refresh.wml"/>
  <refresh>
   <setvar name="x" value="30"/>
  </refresh>
 </anchor>
</p>
</card>
</wml>
 Running the code
1) save the above file as refresh.wml in E:\wml\ Directory
2) Open UPSDK Browser, which will be a shortcut created during installation
3) Type in the URL file://e:/wml/refresh.wml next to GO Button Text Box, Hit Enter ..........
4) Always remember whenever u make changes to the wml script, u must click on Edit Clear Cache to View New Screen and Re-Enter URL
 What Next ? Variables and Form Submission
 Reach me!
   My Web URL : http://www.geocities.com/james_smith73
   If you like this article and/or code mailme or Join our small Group of Java Programmers ,
Till we meet next time BYE     

  Java, J2EE, J2SE and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc.
in the United States and other countries.