Monday 29 October 2018

Reset Values on Page Load in ADF

Reset Page Data on Page Load

Hi Guys,Sometimes we Require to reset the values of component on Page load.

component is not refreshed and the previously entered value will still persist within the component. to resolve this issue we have to use the resetPageData() method to reset the component value and display the components initial state.
Below are the implementation steps which we can follow-

S1- Get handle to the input Text component using the JSFUtils find component method with the        input Text id passed as a parameter.
S2- set the submitted value of the input Text as null.
S3- reset the input component value.
S4- refresh the component.

Write the below code in On Page load event.

private void resetPageData(String id) { 
RichInputText input = (RichInputText)JSFUtils.findComponentInRoot(id); 
input.setSubmittedValue(null); 
input.resetValue(); 
AdfFacesContext.getCurrentInstance().addPartialTarget(input); 
}

Cheers Guys :)

No comments:

Eclipse With Python

Hi Guys, Today i'll share how to start python project in eclipse IDE. to start Py development in eclipse we need to add Py Dev plugi...