Compensation program an input element does not work

Hello

I want to erase a point of entry (RichInputListOfValues) contained in a PanelForm programmatically, once the user presses the button "erase":
<af:commandToolbarButton text="Clear" id="ctb1"
actionListener="#{pageFlowScope.UiBindings.clearItem}"/>
When the code that really should clear the issue is:
    public void clearItem(ActionEvent actionEvent) {
            getItem().setValue(null);
            // getItem().resetValue(); // even with this, it does not work.
            AdfFacesContext.getCurrentInstance().addPartialTarget(getItem());
    }

    public RichInputListOfValues getItem() {
        return item;
    }
However, the foregoing does not erase the element on the page. I have to click a second time to actually see the item empty as expected.
The problem appears even if I also addPartialTarget() on the PanelForm container.

You have an idea?

Hello
Try setSubmittedValue and processUpdates.

{} public void clearItem (ActionEvent actionEvent)
getItem () .setValue (null);
getItem () .resetValue (); even with that, it does not work.
getItem () .setSubmittedValue (null);
getItem () .processUpdates (FacesContext.getCurrentInstance ());
AdfFacesContext.getCurrentInstance () .addPartialTarget (getItem ());
}

Renuka

Tags: Java

Similar Questions

Maybe you are looking for