IBM Webcam R1 Uživatelský manuál Strana 48

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 94
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 47
</logic:notPresent>
</logic:notPresent>
</logic:equal>
This code, which follows the check for drop-down box field, defines how to display the content of
the drop-down box field, if present. Displaying the content of the drop down box requires
denoting which of the available options is selected. If no option is selected, displays the default
value as the selected option:
<%-- ========== --%>
<%-- select box --%>
<%-- ========== --%>
<logic:equal name="customField" property="type"
value="<%=Integer.toString(CustomFieldConst.TYPE_DROP_DOWN)%>">
<select name="<%=cfName%>" id="<%=customField.getName()%>">
<%-- iterate over the options --%>
<logic:iterate id="optionValue" name="customField"
property="optionValues"
type="java.lang.String">
<%
//-- if the entry has a value, make it selected. --//
if ( null != customField.getVal() ) {
if ( optionValue.equals(customField.getVal()) ) {
%>
<option value="<%=optionValue%>"
selected><%=optionValue%></option>
<%
} else {
%>
<option value="<%=optionValue%>"><%=optionValue%></option>
<%
}
//-- the entry has no default, make the default option selected.
--//
} else {
if ( optionValue.equals(customField.getDefaultValue()) ) {
%>
<option value="<%=optionValue%>"
selected><%=optionValue%></option>
<%
} else {
Chapter 5: Customizing JavaServer Pages 43
Zobrazit stránku 47
1 2 ... 43 44 45 46 47 48 49 50 51 52 53 ... 93 94

Komentáře k této Příručce

Žádné komentáře