PPR in tr:selectOneChoice does not work

Posted by Nhut Le on Stack Overflow See other posts from Stack Overflow or by Nhut Le
Published on 2011-01-06T07:46:39Z Indexed on 2011/01/06 7:53 UTC
Read the original article Hit count: 312

Filed under:
|
|
|
|

Hi, I have a simple testing page that test my PPR on a selectOneChoice component. when select a value from selectOnechoice 1, the selected value will display on a output label and also reset the selected value and the other selectOneChoice. However, it prints the selected values to the label correctly but it can't set the selected value for the other selectOneChoice. and

Here are my page and my value change event method.

<tr:form id="nhutForm">         
<tr:selectOneChoice id="one" value="#{nhutTestBean.one}" autoSubmit="true" immediate="true" valueChangeListener="#{nhutTestBean.onMyValueChanged}">
    <tr:selectItem label="0" value="0"/>
    <tr:selectItem label="1" value="1"/>
    <tr:selectItem label="2" value="2"/>
    <tr:selectItem label="3" value="3"/>
</tr:selectOneChoice>

<tr:selectOneChoice id="two" value="#{nhutTestBean.two}" partialTriggers="one">
    <f:selectItems value="#{nhutTestBean.myList}"/>
</tr:selectOneChoice>

<tr:outputText id="nhutTextBox" value="hello: #{nhutTestBean.output}" partialTriggers="one"/></tr:form>

and my valueChangeEvent method:

public void onMyValueChanged(ValueChangeEvent event) {
    this.setOutput((String)event.getNewValue());
    this.setTwo((String)event.getNewValue());
}

One thing I realize is that it calls my setTwo twice, the first the set the correct values, but the second time set it to null so that nothing would be selected for the two drop down box. please help. thank you so much.

© Stack Overflow or respective owner

Related posts about java

Related posts about jsp