<h:selectOneMenu >
<f:selectItem itemLabel="" itemValue="#{null}"/>
<s:selectItems var="tape" itemValue="#{tape.description}"
value="#{tapeformatList.resultList}" label="#{tape.description}" />
<s:convertEntity/>
</h:selectOneMenu>
Note the null element to allow users to leave the selection blank. You can also achieve this by using the noSelectionLabel attribute. Also of note is the itemValue attribute on the Seam selectItems tag: This enables a custom value instead of the automatic numeric ID generated by Seam. In this case, the entity's description is used for the value.
Here's what this code generates in HTML:
<select name="tapeformatSearch:j_id14" size="1">
<option></option>
<option value="VHS">VHS</option>
<option value="DVD">DVD</option>
<option value="Beta-SP">Beta-SP</option>
<option value="Digi-Beta">Digi-Beta</option>
<option value="HD-Cam">HD-Cam</option>
<option value="DV-Cam">DV-Cam</option>
<option value="Mini-DV">Mini-DV</option>
<option value="DVC-PRO HD">DVC-PRO HD</option>
</select>
3 comments:
Very cool, thanks a lot! :)
Very cool! Thank a lot :)
oops, posted it twice :P... because it's double cool :)
Post a Comment