
Originally Posted by
markriggins
the itemLabel="fullLegalName" works great. I'd actually, like to add the email address if any to make it "Mark Riggins:mark@gmail.com" just in case we have more than one Mark Riggins in the system.
One way is to create your own "special" tag, like select2Fields.tagx, and add 2 attributes, field1, and field2, then modifiy the code to concat both the fields in the <form:select>.
or write your own select.tagx that accepts a list of field name to concat.
or copy the code from select.tagx into the jspx file and modify it just for the specific case.
Or on the server side, you could create a transient field that concats the fields and then use that field instead on the itemLabel.
Code:
@Transient
public String fullLegalNameAndAddress() {
StringBuilder sb = new StringBuilder();
sb.append(this.fullLegalName).append(" ").append(this.emailAddress);
return sb.toString();
}
Just depends on what makes most since for your project.