Just another 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=”#{}” >
<f:selectItems value=”#{newCustomerController.newCustomerContacts}”/>

java code to generate select items:

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


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: