IBM R1 Webcam User Manual


 
Submitting a form
If you remove the nav attribute and add an onClick attribute, you completely change the
functionality of the button. This code, for the Login button on the loginForm JSP for the Learning
Management System server, executes a JavaScript submitForm() function when the button is
clicked. This effectively logs the user into the application.
<lms:button captionKey="button.login"
onClick="javascript:submitForm('loginForm');"
tooltipKey="button.login"/>
The Login button on the deliveryLoginForm JSP for the Delivery server contains similar code:
<lms:button captionKey="ds.toolbar.login"
onClick="javascript:submitForm();"
tooltipKey="ds.toolbar.login"/>
Canceling the submission of a form
If you remove the onClick attribute and add an isSubmit attribute set to false, the button now
specifically prevents the entries on the current form from being saved. This code, for a Cancel
button on the assignVendor JSP, sets the isSubmit attribute to false. It includes an href attribute
that contains JavaScript code which instructs the current window to close when the button is
clicked.
<lms:button captionKey="button.cancel" isSubmit="false"
tooltipKey="button.cancel"
href="javascript:window.close()"/>
To edit a tag:
1. Look at the TLD file referenced by the prefix of the tag you want to edit.
This contains a list of attributes associated with the tag.
2. Edit the JSP tag to add, remove, or change the values of the tag’s attributes.
Note: Do not remove required attributes. The TLD file identifies attributes that are
required by specifying “true” in the body of the <required> tag.
For more information on looking at the TLD file to see a tag’s attributes, see “The anatomy of a
TLD file.”
Editing form Bean values with the lms:hidden tag
The lms:hidden tag is a tag that produces an HTML input tag with a type attribute value set to
“hidden.” This tag enables you to get and set values in the form Bean (which is a Java component
that, among other things, saves user input) associated with the current form.
The name attribute identifies the form Bean. The property attribute represents a property setting
in the form Bean. The value attribute sets the input tag values, which can be later saved to the
form bean. If you do not supply a value attribute, the HTML input tag gets values for specified
properties from the form Bean.
The following code creates a hidden HTML input tag. Because a value attribute is supplied, the
resulting input tag sets the “destination” property of the form Bean associated with the
assignVendor.jsp to that value. The value is set using a JSP expression that gets the value of the
destination parameter from the user request:
<lms:hidden property="destination"
value='<%=request.getParameter("destination")%>'
/>
40 IBM Lotus Learning Management System Release 1 Customization Guide