Reset Binding Value from InputText in Oracle ADF

Use Case – We have one jsff page and contains some inputtext .On same page there is one Save button and one Cancel button.When user came to the page and try to enter some value in input text field and user click on Cancel button, its not resetting InputText value.When user come on same page again then he can able to see my previously entered value in Input Text though user clicked on cancel.

Normal developer will wrote Action Listener on Cancel Button and wrote below code

input.resetValue() ;

But its will work (reset values).Setting value in input will not work like


Few developers will think, why cant we use resetActionListener. It will work for sure,but if you make autoSubmit of inputText to true, it will not work.
Reason- InputText has autoSubmit set to true, which submit the values to model immediately after updating it, resetActionListener resets values only if changes are not populated to model.

For this case use below code.Get current row and do REFRESH_FORGET_NEW_ROWS

    Row r1=vo.getCurrentRow(); 
    r1.refresh(oracle.jbo.Row.REFRESH_UNDO_CHANGES |  Row.REFRESH_FORGET_NEW_ROWS);  

Note : If you don’t need autoSubmit, you can just remove it and use resetActionListener without any bean method to undo current row changes

It will reset binding value of input text.

Happy learning with Vinay Kumar in techartifact..

Disable the symbol of the required field of the label of inputtext

Requirement – Disable the symbol of the required field of the label of inputtext
Solutions- add the following code in your css skin file


Note – It will disabled * icon entire application

Now if you want to hide * icon only for particular inputText

then add add the ‘styleClass’ attribute in inputText

<af:inputText label="First Name" id="it1" styleClass="requiredField" required="true"/>

In the css skin file, add a new class style as follows:

.requiredField span

  visibility: hidden;

happy learning with Vinay in techartifact