Java Reference
In-Depth Information
Download email_19/web/WEB-INF/jsp/message_compose.jsp
<jsp:useBean class="stripesbook.action.ContactListActionBean"
id="contacts"/>
<!-- ... -->
<s:form beanclass="stripesbook.action.MessageComposeActionBean">
<!-- ... -->
<s:select name="contacts" multiple="true" size="7">
<s:options-collection collection="${contacts.contacts}"
value="id" sort="firstName"/>
</s:select>
<!-- ... -->
</s:form>
</s:layout-component>
Inside <s:select>, the <s:options-collection> tag generates options
from the list of contacts obtained from ContactListActionBean . Notice that
you can use the sort= attribute to indicate the property by which to sort
the objects of the collection. We're sorting the contacts by their first
name.
A multiple-selection box acts much like a series of checkboxes that are
bound to a Collection property. In this case, the selected contacts are
bound to the contacts property of the MessageComposeActionBean class:
Download email_19/src/stripesbook/action/MessageComposeActionBean.java
private List<Contact> contacts;
public List<Contact> getContacts() {
return contacts;
}
public void setContacts(List<Contact> contacts) {
this .contacts = contacts;
}
Stripes automatically puts the selected contacts in the list so that we
can add them to the To, Cc, or Bcc field.
8.3
Image Buttons and Text Areas
Continuing with the Message Compose page, let's add the image but-
tons with arrows that are next to the contact list select box and add the
text area where the user can compose the text of the message.
Using Image Buttons
The <s:image> tag creates an image button that invokes the action
bean event handler indicated in the name= attribute.
 
 
 
Search WWH ::




Custom Search