Senin, 18 Juli 2011

WML 8

WML Anchor Links

Anchor links enable the navigation between different WML cards. If you select an anchor link, you will be brought to another WML card in the current deck or in another deck.
The <anchor></anchor> tag pair is used to create an anchor link. It is used together with tags such as <go/> and <prev/>, which tell WAP browsers what to do when a user selects the anchor link. <go/> and <prev/> should be enclosed within the <anchor></anchor> tags, like this:

<anchor>
  <go href="..." ... />
</anchor>

<anchor>
  <prev/>
</anchor>

Like HTML, WML uses a URL (Uniform Resource Locator) to refer to the location of a WML file or a card in a deck. The href attribute of the <go/> tag is used to specify the URL. Both absolute and relative URLs are accepted. URLs in WML have the same form as those in HTML. Here is the general form of an absolute URL in WML:

http://host_name/path/file_name#offset?parameter1=value1&parameter2=value2...

The protocol used in WML URLs is HTTP. The reason is that WAP gateways request WML files from ordinary web servers using the HTTP protocol, although wireless devices communicate with WAP gateways using WAP protocols.

Programming Softkeys of Mobile Phones and the <do> Element

Now let us introduce to you another useful element in WML -- the <do> element. The <do> element is used to associate a task to a certain user interface element of a wireless device. The task will be done if the user activates the user interface element. The mapping between a <do> element and a user interface element depends on the actual wireless device. The WAP specification states that the user interface element may be a softkey, a function key, a voice-activated command, etc. In mobile phones, <do> elements are very often associated to softkeys or items in the options menu that is brought up by pressing a softkey. To program softkeys of mobile phones, we need to know how to use the <do> element.
The <do> element is not difficult to use. Tasks such as <go>, <prev> and <refresh> are enclosed in the <do></do> tags. The name attribute of <do> specifies a unique name to a <do> element. The labelattribute specifies the label to be displayed on the wireless device's screen (if applicable). The number of characters in a label should be equal to or smaller than six if you want it to be displayed nicely on different types of wireless device. If a label is too long, it may be truncated on some wireless devices.
The type attribute of the <do> element is mandatory. It specifies which type of user interface element should be associated to a <do> element. Some commonly used attribute values are acceptoptions andprev.
If the type attribute value is accept, the <do> element is associated to a user interface element that can provide a way for the user to accept some kind of action. The ACCEPT element is usually the left softkey in mobile phone browsers, since the left softkey is used as the "Yes" or "OK" softkey typically. The table below gives some descriptions of how ACCEPT elements are presented on some mobile phone emulators:

Mobile phone emulators
Descriptions of the ACCEPT element
Nokia Mobile Browser 4.0
If you press the Options softkey on the left, you will see all the ACCEPT elements.
Openwave Mobile Browser 6.2.2
The first ACCEPT element becomes the left softkey.
If there are two ACCEPT elements, the second one becomes the right softkey.
If there are more than two ACCEPT elements, the right softkey will be labeled as Menu. You can see the second to the nth ACCEPT elements if you press the Menu softkey, where n is the total number of ACCEPT elements.
Sony Ericsson T610 mobile phone
If you press the More softkey on the right, the options menu is opened and you can see all the ACCEPT elements there.
Sony Ericsson T68i mobile phone
If you press the "Options menu" button (located between the Yes button and the 1 button), the options menu is opened and you can see all the ACCEPT elements there.

If the type attribute value is options, the <do> element is associated to a user interface element that can provide users further options or operations to choose from. Very often WAP browsers place the OPTIONS elements in an options list and they provide a certain way for you to bring up the options list, such as pressing a softkey or a physical button. The table below gives some descriptions of how OPTIONS elements are presented on some mobile phone emulators:

Mobile phone emulators
Descriptions of the OPTIONS element
Nokia Mobile Browser 4.0
If you press the Options softkey on the left, you will see all the OPTIONS elements. (Presented in the same way as the ACCEPT element)
Openwave Mobile Browser 6.2.2
The first OPTIONS element becomes the right softkey.
If there are two or more than two OPTIONS elements, the right softkey will be labeled asMenu. You can see the second to the nth OPTIONS elements if you press the Menusoftkey, where n is the total number of OPTIONS elements.
Sony Ericsson T610 mobile phone
If you press the More softkey on the right, the options menu is opened and you can see all the OPTIONS elements there. (Presented in the same way as the ACCEPT element)
Sony Ericsson T68i mobile phone
If you press the "Options menu" button (located between the Yes button and the 1 button), the options menu is opened and you can see all the OPTIONS elements there. (Presented in the same way as the ACCEPT element)

If the type attribute value is prev, the <do> element is associated to a user interface element that enables users to navigate backwards. The PREV element is usually the "Back" softkey or physical button of a wireless device. The table below gives some descriptions of how PREV elements are presented on some mobile phone emulators:

Mobile phone emulators
Descriptions of the PREV element
Nokia Mobile Browser 4.0
The first PREV element becomes the right softkey.
If there are two or more than two PREV elements, you can see the second to the nth PREV elements if you press the Options softkey on the left, where n is the total number of PREV elements.
Openwave Mobile Browser 6.2.2
The first PREV element becomes the Back button.
If there are two PREV elements, the second one becomes the right softkey.
If there are more than two PREV elements, the right softkey will be labeled as Menu. You can see the second to the nth PREV elements if you press the Menu softkey, where n is the total number of PREV elements.
Sony Ericsson T610 mobile phone
If you press the More softkey on the right, the options menu is opened and you can see all the PREV elements there.
Sony Ericsson T68i mobile phone
If you press the "Options menu" button (located between the Yes button and the 1 button), the options menu is opened and you can see all the PREV elements there.



Free Template Blogger collection template Hot Deals BERITA_wongANteng SEO theproperty-developer

0 komentar:

Posting Komentar

"my facebook"