Jsf 2.0 Populate h:selectOneMenu to access page?

Look here: @ManagedBean(name = "Person") @ViewScoped public class PersonBean { You've declared the managed bean name as Person. So it's in JSF EL available as #{Person}. Yet you're attempting to access it as #{PersonBean}.

Because such a bean does not exist, the menu remains empty. You've 3 options: Rename #{PersonBean} by #{Person} in your JSF page. Rename @ManagedBean(name = "Person") to @ManagedBean(name = "PersonBean") in your managed bean.

Get rid of bean name and use the default JSF naming conventions. I.e. Just use @ManagedBean without a name and use #{personBean} in your JSF page (in essence, the bean's class name with first character lowercased).

Option 3 is preferred.

Ok is working right now. Thank you all. Especially to BalusC.

– NestorInc Sep 11 '10 at 20:44 You're welcome. – BalusC Sep 11 '10 at 21:01.

It should be "personBean" instead of "PersonBean" (first letter should be lowercase). You also need getter for status (getStatus()) and setter/getter for idStatus (setIdStatus()/getIdStatus()). Are they there?

Have you tried using List instead of Array of SelectItems. Below code might help you. Private List status = new ArrayList(); status.

Add(new SelectItem("S","Single")); status. Add(new SelectItem("M","Married")); status. Add(new SelectItem("D","Divorced")); /* SETTER / GETTER.

Nope, both ways are equally valid. – BalusC Sep 9 '10 at 14:05 This is the complete code. Please help me – NestorInc Sep 10 '10 at 1:11.

Private Mapstatus = new HashMap(); ....... status. Put("S", "Single"); status. Put("M", "Married"); status.

Put("D", "Divorced"); in JSF PAGE.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions