I have a page with form and table created using the same View Object, is it possible to have a single reset/clear button to reset the form as well as the table?
I tried this:
public String clear_action() {
BindingContainer bindings = GenericUtility.getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
}
DCBindingContainer dcBindings = GenericUtility.getDCBinding();
DCIteratorBinding searchIter;
searchIter = dcBindings.findIteratorBinding("RegionMasterviewcrieria1Iterator");
searchIter.clearForRecreate();
RichInputText dd =
(RichInputText)FacesContext.getCurrentInstance().getViewRoot().findComponent("regPt1:regIt1");
dd.setDisabled(false);
return null;
}
But the problem with this is that if I click on a row (say 2nd row) in the table, the corresponding values get updated in the form. Now if I try to reset both the form and table, I will not be able to select the same row (2nd) again.
I will have to select another row and then come back to the 2nd row.
I just included this line of code in the clear()
table.getSelectedRowKeys().clear();
Hope this helps some one down the line...