Friday, 15 September 2017

JDeveloper 12c Oracle ADF Clear the Selected Value from LOV

LOV Fields are: fnameId and lnameId
Button: Clear
Create Managed Bean and write the following code:

public void clearLOVValues()
{
FacesContext facesContext = FacesContext.getCurrentInstance();
        UIViewRoot root = facesContext.getViewRoot();
        ComponentReference<RichInputListOfValues> richText1  =
        ComponentReference.newUIComponentReference((RichInputListOfValues)root.findComponent("fnameId"));
        RichInputListOfValues FinputText1  = richText1.getComponent();
       
        ComponentReference<RichInputListOfValues> richText2  =
        ComponentReference.newUIComponentReference((RichInputListOfValues)root.findComponent("lnameId"));
        RichInputListOfValues LinputText2  = richText2.getComponent();
             
        FinputText1.setValue("");
        LinputText2.setValue("");
}

Properties for LOV1 and LOV2:
AutoSubmit=True
PartialTrigger to Clear

No comments:

Post a Comment