Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Value change listener on select one choice is not working

Suchith ShivakumarJan 27 2014 — edited Jan 29 2014

Hello all,

I have a Jsff page in that i have 2 panel group layout with panel form layout with some input fields in both.

in first panel form layout i have select one choice drop down with 2 values in that.

based on the selection of the list the second panel group layout will get rendered/visible(suggest me which one to use)

but i am facing the problem when i select the value from the drop down it will navigate to the main page.

here is my code.

<af:selectOneChoice value="#{bindings.IsPersentAddDifferent.inputValue}"

                                label="#{bindings.IsPersentAddDifferent.label}"

                                required="#{bindings.IsPersentAddDifferent.hints.mandatory}"

                                shortDesc="#{bindings.IsPersentAddDifferent.hints.tooltip}"

                                id="soc1"

                                valueChangeListener="#{UserManagement.isPresentAddresVCL}"

                                autoSubmit="true">

              <af:selectItem label="Yes" id="si1" value="Y"/>

              <af:selectItem label="No" id="si2" value="N"/>

            </af:selectOneChoice>

bean code:

    private RichPanelGroupLayout updateValue;

   

    public void isPresentAddresVCL(ValueChangeEvent valueChangeEvent) {

        valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());

        System.out.println(valueChangeEvent.getNewValue().toString());

        if (valueChangeEvent.getNewValue() != null &&

            valueChangeEvent.getNewValue().toString().equalsIgnoreCase("Y"))

            updateValue.setVisible(false);

        else if (valueChangeEvent.getNewValue() != null &&

                 valueChangeEvent.getNewValue().toString().equalsIgnoreCase("N"))

            updateValue.setVisible(true);

        AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();

        adfFacesContext.addPartialTarget(updateValue);

    }

    public void setUpdateValue(RichPanelGroupLayout updateValue) {

        this.updateValue = updateValue;

    }

    public RichPanelGroupLayout getUpdateValue() {

        return updateValue;

    }

   

}

and i have changed autosubmit =true for the select one choice and partialtrigger =si1 si2 for the secound panel group layout

Thanks in advance

Cheers

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 26 2014
Added on Jan 27 2014
5 comments
757 views