4 Replies Latest reply: Jun 21, 2011 9:15 PM by 870241 RSS

    can't delete synchronize

    870241
      when I delete a row ,because of finding child record ,it can't committed to database,but in the jspx,the record has been deleted.And how to synchronize?
        • 1. Re: can't delete synchronize
          838655
          How do you delete the row?

          by EL?
          you have to add a commit as well (as button or Java method)
          "#{bindings.Commit.execute}"
          • 2. Re: can't delete synchronize
            870241
            I wrote the code in the backingBean :
            operationBinding = bindings.getOperationBinding("Commit");
            result = operationBinding.execute();
            to delete the row.
            • 3. Re: can't delete synchronize
              838655
              this is how i delete and commit from java..

              public void deleteS{
              BindingContainer bindings = getBindings();
              OperationBinding operationBinding = bindings.getOperationBinding("Delete");
              Object result = operationBinding.execute();

              //invokeEL is a method in ADFUtils class
              invokeEL("#{bindings.Delete.execute}");
              invokeEL("#{bindings.Commit.execute}" );
              }



              /**
              * Programmatic invocation of a method that an EL evaluates to.
              * The method must not take any parameters.
              *
              * @param el EL of the method to invoke
              * @return Object that the method returns
              */
              public static Object invokeEL(String el) {
              return invokeEL(el, new Class[0], new Object[0]);
              }


              /**
              * Programmatic invocation of a method that an EL evaluates to.
              *
              * @param el EL of the method to invoke
              * @param paramTypes Array of Class defining the types of the parameters
              * @param params Array of Object defining the values of the parametrs
              * @return Object that the method returns
              */
              public static Object invokeEL(String el, Class[] paramTypes,
              Object[] params) {
              FacesContext facesContext = FacesContext.getCurrentInstance();
              ELContext elContext = facesContext.getELContext();
              ExpressionFactory expressionFactory =
              facesContext.getApplication().getExpressionFactory();
              MethodExpression exp =
              expressionFactory.createMethodExpression(elContext, el,
              Object.class, paramTypes);

              return exp.invoke(elContext, params);
              }

              it works for me...
              • 4. Re: can't delete synchronize
                870241
                thank you for your reply,but I mean the record had a child record, delete can't be execute.In the jspx page,it was deleted.
                it prompt can't delete,but the record can't be saw any more.In fact it has been delete in the VO,but not in the database.I want to see the database result in the page.

                Edited by: 867238 on 2011-6-21 下午7:14