Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cancel/Reset/Rollback for Form does not work

Arif KhadasFeb 15 2016 — edited Feb 18 2016

Dear All,

I am Beginner in ADF and am using Jdeveloper Studio Edition Version 12.2.1.0.0.

I am having a page which consists of Two taskflows.

First Task flow has a fragment which is having a table (non editable)

Second Task Flow contains an ADF Form

On the form I have added a Cancel/Rollback Button which has the following code

<af:button text="Undo" id="bCancel" actionListener="#{pageFlowScope.salespersonsForm.doCancel}"

                               icon="/icons/cancel.png" iconPosition="top"

                               partialTriggers="bCreate bCancelInsert bSaveInsert"

                               binding="#{pageFlowScope.salespersonsForm.buttonCancel}" immediate="true" />

    public void doCancel(ActionEvent actionEvent) {

        BindingContainer bindings = getBindings();

        DCIteratorBinding iter = (DCIteratorBinding)bindings.get("SalespersonsUO1Iterator");

        Key currentKey = iter.getCurrentRow().getKey();

        OperationBinding operationBinding;

        operationBinding = (OperationBinding) bindings.getOperationBinding("Rollback");

        Object result = operationBinding.execute();

        SalespersonsForm.refreshView();

        iter.setCurrentRowWithKey(currentKey.toStringFormat(true));

    }

    private static void refreshView() {

        FacesContext fctx;

        fctx = FacesContext.getCurrentInstance();

        String cv;

        cv = fctx.getViewRoot().getViewId();

        ViewHandler vh = fctx.getApplication().getViewHandler();

        UIViewRoot ui = vh.createView(fctx, cv);

        fctx.setViewRoot(ui);

    }

The above is not helpful and there is no refresh of the data entered.

Also after clicking on this button Next and Previous buttons start working strangely.

Thanks & Regards

Arif Khadas

This post has been answered by Ashish Awasthi on Feb 15 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 17 2016
Added on Feb 15 2016
17 comments
1,806 views