Sun Java System Portal Server Mobile Access 7.1 Developer's Reference

AmlChoice

Description

An AmlChoice is a list of AmlOptions available for selection. The item selected becomes the value of the variable in the name attribute. An AmlText serves as the label of the AmlChoice. An example of an AmlChoice is a list of Countries where users select one to convey where they live.

Element Body

((AmlContainer*, AmlText?, AmlOption+, AmlStyle?)

Parent

AmlForm, AmlTableCol, AmlGroup, AmlListItem

Restrictions

None

AML Attributes

Attribute  

Description  

Possible values  

Default  

Req’d?  

name 

Set name used for form input 

CDATA 

No Default 

No 

mode 

Single or Multiple selection 

(multiple|single) 

single 

No 

view 

Set view option 

(show|hidden|none) 

show 

No 

wml_select_label 

Set the label for submit for WML 

CDATA 

No Default 

No 

cache 

Set caching 

(true|false) 

true 

No 

persist 

Set persist flag 

(true|false) 

false 

No 

italics 

Deprecated

(true|false) 

false 

No 

bold 

Deprecated

(true|false) 

false 

No 

underline 

Deprecated

(true|false) 

false 

No 

text 

Deprecated

CDATA 

No Default 

No 

textsize 

Deprecated

(big|normal|small) 

normal 

No 

scroll_size 

Deprecated 

CDATA 

No Default 

No 

value 

Value used as form input 

CDATA 

No Default 

No 

Markup Language Examples

Sample AML Input:

<AmlDocument title="Choice Test">
	<AmlPage title="Choices">
		<AmlForm url="resources">
			<AmlChoice name="c1">
			<AmlOption value="o1" text="o1"/>
			<AmlOption value="o2" text="o2"/>
			</AmlChoice>
		</AmlForm>
	</AmlPage>
</AmlDocument>

Sample WML Output:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head><meta http-equiv="Cache-Control" content="max-age=0"/></head>
	<card id="agp0"><p align="center">Choices</p>
		<p mode="nowrap">
		<select multiple="false" name="c1">
			<option value="o1" title="select">o1</option>
			<option value="o2" title="select">o2</option>
		</select>
		</p>
		<do label="submit" type="accept">
			<go href="resources?c1=$(c1)" sendreferer="true" method="get"/>
		</do>
	</card>
</wml>

Sample cHTML Output:

<html>
<head>
		<title>Choice Test</title>
		<meta name="PalmComputingPlatform" content="true"></meta>
		<meta http-equiv="Pragma" content="no-cache"></meta>
		<meta http-equiv="Cache-Control" content="no-cache"></meta>
</head>
<body>
		<div align="center">
			<a name="agp0">Choices</a>
		</div>
		<form enctype="application/x-www-form-urlencoded"
		action="resources" method="get">
			<select name="c1"><option value="o1">o1</option>
			<option value="o2">o2</option>
			</select><br>
		<input name="request" type="submit" value="Submit"></input>
		</form>
</body>
</html>