| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html> |
| <head> |
| <title>wml:PropertySelection</title> |
| <link rel="stylesheet" type="text/css" href="Tapestry.css" title="style"> |
| </head> |
| <body> |
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td align="left"><a href="wml.Postfield.html"><img alt="Postfield" src="common-images/prev.png"></a></td> |
| <td align="middle"><a href="index.html"><img alt="Component Index" src="common-images/home.png" ></a></td> |
| <td align="right"><a href="wml.Select.html"><img alt="Select" src="common-images/next.png"></a></td> |
| <tr> |
| <tr> |
| <td colspan="3"> |
| <hr> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="3"> |
| <table border="0" cellpadding="4" cellspacing="4" width="100%"> |
| <tr valign="top"> |
| <td> |
| <table> |
| <tr> |
| <td><font size="+2"><b>wml:PropertySelection</b></font></td> |
| </tr> |
| <tr> |
| <td> <A href="../api/org/apache/tapestry/wml/PropertySelection.html">org.apache.tapestry.wml.PropertySelection</a> |
| </td> |
| </tr> |
| </table> |
| </td> |
| <td> |
| <table align="right" valign="middle" cellpadding="8"> |
| <tr> |
| <td><IMG alt="Image Component" src="images/wml.propertyselection.png" ></td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| <tr valign="center"> |
| <td colspan="2" height="23"> </td> |
| </tr> |
| <tr> |
| <td colspan="2"> <b>Description</b> <br> |
| Creates an WML select to choose a single property from a list of options. |
| </td> |
| </tr> |
| <tr> |
| <td colspan="2"> <b>See Also</b> <br> |
| <A href="wml.Go.html">wml:Go</a>, <A href="wml.SelectionField.html">wml:SelectionField</a> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="2"> <b>Parameters</b> <br> |
| <table border="1" cellpadding="4" cellspacing="4" class="parameters"> |
| <tr> |
| <th>Name</th> |
| <th>Type</th> |
| <th>Direction</th> |
| <th>Required</th> |
| <th>Default</th> |
| <th>Description</th> |
| </tr> |
| <tr> |
| <td>name</td> |
| <td>String</td> |
| <td>in</td> |
| <td>yes</td> |
| <td> </td> |
| <td> The property to set. During rendering, this property is read, |
| and sets the default value of the selection (if it is null, |
| no element is selected). When the <go> is submitted, this |
| property is updated, with the help of SelectionField component, |
| based on the new selection. </td> |
| </tr> |
| <tr> |
| <td>model</td> |
| <td> <A href="../api/org/apache/tapestry/form/IPropertySelectionModel.html"><tt>IPropertySelectionModel</tt></a> |
| </td> |
| <td>auto</td> |
| <td>no</td> |
| <td> </td> |
| <td> The model provides a list of possible labels, and matches |
| those labels against possible values that can be assigned back |
| to the property. </td> |
| </tr> |
| </table> |
| <p> Body: <strong>removed</strong><br> |
| Informal parameters: <strong>allowed</strong><br> |
| Reserved parameters: none </p> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="2"> <p><b>Example</b> </p> |
| <p>Template</p> |
| <pre> <card id="card1" title="Animal QUIZ" newcontext="true"><br> <p>Welcome!<br> <br/><br> Your name:<br> <input jwcid="userInput" name="username" title="Your name" value=""/><br> </p><br> <p><br> Difficulty:<br> <b jwcid="selectLevel"/><br> </p><br> <p><br> <do type="help" label="Instructions"><br> <go href="#help"/><br> </do><br> <do type="options" label="Zoo home"><br> <go jwcid="@ServiceLink" service="ognl:@org.apache.tapestry.Tapestry@HOME_SERVICE" renderer="ognl:@org.apache.tapestry.wml.GoLinkRenderer@SHARED_INSTANCE" href=""/><br> </do><br> </p><br> <p><br> <anchor title="Start">Start<br> <go jwcid="go"><br> <postfield jwcid="username" name="username" value="username"/><br> <postfield jwcid="level" name="level" value="level"/><br> </go><br> </anchor><br> <br/><br> <anchor title="Instructions">Instructions<br> <go href="#help"/><br> </anchor><br> </p><br> </card><br> |
| </pre> |
| <p>Specification</p> |
| <pre> <page-specification class="org.apache.tapestry.wap.quiz.Home"> |
| <component id="username" type="<a href="wml.Postfield.html">wml:Postfield</a>"> |
| <binding name="value" expression="username"/> |
| <binding name="name" expression="components.userInput.name"/> |
| </component> |
| <component id="level" type="<a href="wml.SelectionField.html">wml:SelectionField</a>"> |
| <binding name="value" expression="level"/> |
| <binding name="model" expression="components.selectLevel.model"/> |
| <binding name="name" expression="components.selectLevel.name"/> |
| </component> |
| <component id="userInput" type="<a href="wml.Input.html">wml:Input</a>"> |
| <static-binding name="name">username</static-binding> |
| <binding name="value" expression="username"/> |
| </component> |
| <component id="selectLevel" type="<a href="wml.PropertySelection.html">wml:PropertySelection</a>"> |
| <static-binding name="name">level</static-binding> |
| <binding name="model" expression="@org.apache.tapestry.wap.quiz.Home@LEVEL_MODEL"/> |
| </component> |
| <component id="go" type="<a href="wml.Go.html">wml:Go</a>"> |
| <binding name="stateful" expression="false"/> |
| <binding name="listener" expression="listeners.start"/> |
| </component> |
| <property-specification name="username" type="java.lang.String" persistent="yes"/> |
| <property-specification name="level" type="java.lang.String" persistent="yes" initial-value='"easy"'/> |
| </page-specification></pre> |
| <p>Java </p> |
| <pre> |
| public abstract class Home extends Deck |
| { |
| |
| public static final IPropertySelectionModel LEVEL_MODEL = new StringPropertySelectionModel |
| (new String[] { Global.EASY_LEVEL, Global.MEDIUM_LEVEL, Global.HARD_LEVEL }); |
| |
| public void start(IRequestCycle cycle) |
| { |
| ..... |
| ..... |
| } |
| |
| public abstract String getUsername(); |
| |
| public abstract String getLevel(); |
| }</pre> |
| </td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="3"> |
| <hr> |
| </td> |
| </tr> |
| <tr> |
| <td align="left"><a href="wml.Postfield.html"><img alt="Postfield" src="common-images/prev.png"></a></td> |
| <td align="middle"><a href="index.html"><img alt="Component Index" src="common-images/home.png" ></a></td> |
| <td align="right"><a href="wml.Select.html"><img alt="Select" src="common-images/next.png"></a></td> |
| </tr> |
| </table> |
| </body> |
| </html> |