views:

30

answers:

1

I have two instances of selectOneMenu, one dependent on the other. But my processValueChange in the bean is never invoked. JSP portion:

<h:selectOneMenu id="slaPeriod" onchange="submit()" required="true"> 
  <f:selectItems value="#{LoginForm.periodList}"/>
  <f:valueChangeListener type="form.LoginForm" />
</h:selectOneMenu>

I want to have the selected option and have an associated option in the next selectOneMenu. If say option is:

 OPTIONS       VALUES
 1. Weekly     1....52
 2. Monthly    Jan...Dec
 3. Quaterly   1...4
 4. Yearly     this drop down has to be disabled

Associated bean :

public void processValueChange(ValueChangeEvent arg0) throws AbortProcessingException 
{
  System.out.println("Inside Process Value Change!!");
}

This method is never invoked. Once this is done my problem will be resolved.

If you have any idea please help me, I'm really confused. Every time there is a refresh action on selection but this method of the bean is never invoked.

A: 

Try the following:

  • Have you enclosed <h:selectOneMenu> within a <h:form> ?
  • Does your bean implements ValueChangeListener interface?
  • Is your bean inside the form package
  • Is your bean session scoped or request scope? (I'd suggest to try with session scope)
  • Is there any error on the console?
pakore