IBM Webcam R1 Manual do Utilizador Página 48

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 94
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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
Vista de página 47
1 2 ... 43 44 45 46 47 48 49 50 51 52 53 ... 93 94

Comentários a estes Manuais

Sem comentários