Java Reference
In-Depth Information
<d:column property="from" sortable="true"/>
<d:column property="to" sortable="true"/>
<d:column title="Subject" sortable="true">
<s:link
beanclass="stripesbook.action.MessageDetailsActionBean">
<s:param name="message" value="${message.id}"/>
${message.subject}
</s:link>
</d:column>
</d:table>
</s:layout-component>
</s:layout-render>
The folder list is now fully functional, and we're just getting warmed
up.
9.2
Altering Form Values in the Action Bean
Remember that in the Message Compose page we had a list of contacts
in a select box and arrow buttons to add the selected contacts to the
list of recipients:
Each arrow button invokes an event handler that builds a string from
the text field and the selected contacts. It's tempting to just change the
value of the message's to , from , or bcc property in the action bean and
expect the new value to show up in the corresponding text field:
Download email_19/src/stripesbook/action/MessageComposeActionBean.java
public Resolution addTo() {
getMessage().setTo(getRecipientString(getMessage().getTo()));
return new ForwardResolution(COMPOSE);
}
public Resolution addCc() {
getMessage().setCc(getRecipientString(getMessage().getCc()));
return new ForwardResolution(COMPOSE);
}
public Resolution addBcc() {
getMessage().setBcc(getRecipientString(getMessage().getBcc()));
return new ForwardResolution(COMPOSE);
}
private String getRecipientString(String previous) {
if (contacts != null ) {
 
 
 
Search WWH ::




Custom Search