2 Replies Latest reply: Sep 30, 2013 5:33 AM by 1012433 RSS

    Restricting create insert button more than one time using

    1012433

      Hi,

      I am using jdev 11.1.2.3

      My requirement like this,I have insert control for getting insert mode of form  when click on it using managed bean method ...

      when i enter data without saving again click on this insert control it goes to insert mode, but i need to restrict this situation with

      popup wit text "do you want to save data" with Yes and No buttons...

       

      How to achieve this any idea.......

       

       

      Thank You.

        • 1. Re: Restricting create insert button more than one time using
          Frank Nimphius-Oracle

          Hi,

           

          in the managed bean, check the state of the transaction. Call

           

          ControllerContext.getInstance().getCurrentViewPort().isDataDirty() this returns true if there are pending data changes. you can then commit or rollback before you progress. The managed bean, in case of dirty data, would show a popup for the user to decide what to do

           

          Frank

          • 2. Re: Restricting create insert button more than one time using
            1012433

            Hi Frank,

            Thanks  for your response...

            Actually my bean class method is in insert mode in this time i want to call this methods

            this is my method:

            public void performAddNew(BindingContainer bindings) {

                OperationBinding operationBinding = (OperationBinding)bindings.getOperationBinding("CreateInsert");
               
                Object result = operationBinding.execute();
                if (!operationBinding.getErrors().isEmpty()) {
                addFacesMessage(FacesMessage.SEVERITY_INFO, "There is an error while performing the operation");
                }

            How to call this in my method ...

            and it is true pop i want...

             

             

            Thank You.