[英]How to make two JSF selectOneMenu that depend on each other?
I have two instances of selectOneMenu
, one dependent on the other. 我有两个selectOneMenu
实例,一个实例依赖于另一个实例。 But my processValueChange
in the bean is never invoked. 但是我的bean中的processValueChange
从未被调用。 JSP portion: JSP部分:
<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
. 我要具有选定的选项,并在下一个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. 每次对选择进行刷新操作时,都不会调用该bean方法。
Try the following: 请尝试以下操作:
<h:selectOneMenu>
within a <h:form>
? 您是否已将<h:selectOneMenu>
包含在<h:form>
? ValueChangeListener
interface? 您的bean是否实现ValueChangeListener
接口? form
package 您的bean是否在form
包中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.