zwwcn

Just another WordPress.com site

“The converter works with any managed entity”.

if we have to include unmanaged entity into selectone menu, we will need manually create select items.

Jsf page:

<h:selectOneMenu id=”contact” required=”true” styleClass=”input”  value=”#{jobAddress.contact}” >
<f:selectItems value=”#{newCustomerController.newCustomerContacts}”/>
</h:selectOneMenu>

java code to generate select items:

for(Contact contact : selectedCustomer.getContacts()) {
SelectItem item = new SelectItem();
item.setValue(contact);
item.setLabel(contact.getFirstName() + ” ” + contact.getLastName());
newCustomerContacts.add(item);
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: