key from the appropriate .properties file. Similarly, the “tooltipKey” attribute defines the
resource key to retrieve for display in the window status bar when the button is moused over to
define the action the button performs. The “href” attribute defines the action to perform when the
button is clicked. This href calls the customFieldsPopup() function, which is Javascript code that
is defined in the page header. Setting the “secondary” attribute to true diminishes the visibility of
the button by changing it to a duller color:
<lms:button captionKey="button.edit"
tooltipKey="button.alt.manageCustomProperties"
href="javascript:customFieldsPopup();"
secondary="true"/>
The last section of code displays a list of any existing custom fields stored in the application.
This piece of code iterates over the customField objects in the CustomFieldHelper class which
accesses the previously created custom fields:
<logic:iterate id="customField" name="<%= formName %>"
property="customFields"
type="com.lotus.elearn.model.CustomFieldHelper">
This code retrieves from each returned custom field a value to use for the label:
<lms:label beanClass="com.lotus.elearn.model.CustomFieldHelper"
instance="<%=customField%>"
id="<%=customField.getValidationLabelId(cfName)%>">
<lms:staticText name="customField" property="name" />
</lms:label>
It then checks to see if it's a text box type field:
<logic:equal name="customField" property="type"
value="<%=Integer.toString(CustomFieldConst.TYPE_TEXTBOX)%>">
or a drop down box type field:
<logic:equal name="customField" property="type"
value="<%=Integer.toString(CustomFieldConst.TYPE_DROP_DOWN)%>">
This code, which follows the check for a text box field, defines how to display the content of the
textbox field, if present, or the default value for the text box field, if available, or an empty text
box field, if no other value is supplied:
<%-- if a value for this entry is present, display that --%>
<logic:present name="customField" property="val">
<input type="text" size="20" name="<%=cfName%>"
value="<%=customField.getVal()%>"/>
</logic:present>
<%-- if a value for this entry is NOT present, display the default
or a blank
%>
<logic:notPresent name="customField" property="val">
<%-- default value if present --%>
<logic:present name="customField" property="defaultValue">
<input type="text" size="20" name="<%=cfName%>"
value="<%=customField.getDefaultValue()%>"/>
</logic:present>
<%-- blank --%>
<logic:notPresent name="customField" property="defaultValue">
<input type="text" name="<%=cfName%>" size="20" value=""/>
42 IBM Lotus Learning Management System Release 1 Customization Guide