Forum Stats

  • 3,816,303 Users
  • 2,259,168 Discussions
  • 7,893,449 Comments

Discussions

Unable to Update Record in adf mobile

Uthman
Uthman Member Posts: 84
edited Jun 21, 2014 9:50AM in JDeveloper and ADF

Hi.

i am new to adf mobile. i have a webservice that i created from appmodule . i have a list in my amx page which shows all the employees. on clicking the item, user is shown the detail of that employee. on the detail page i have a button to delete and a button to update. i am deleting employee via this bean method

public void delete(ActionEvent actionEvent) {
    // Add event code here...
    AdfELContext adfELContext = AdfmfJavaUtilities.getAdfELContext();
    ValueExpression ve =
        AdfmfJavaUtilities.getValueExpression("#{bindings.DepartmentId.inputValue}", int.class);
    ValueExpression ve3 =
        AdfmfJavaUtilities.getValueExpression("#{bindings.DepartmentId1.inputValue}", int.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    ve = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpAddress.inputValue}", String.class);
    ve3 = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpAddress1.inputValue}", String.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    ve = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpDesignation.inputValue}", String.class);
    ve3 = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpDesignation1.inputValue}", String.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    ve = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpId.inputValue}", int.class);
    ve3 = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpId1.inputValue}", int.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    ve = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpName.inputValue}", String.class);
    ve3 = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpName1.inputValue}", String.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    ve = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpPhone.inputValue}", String.class);
    ve3 = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpPhone1.inputValue}", String.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    ve = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpSalary.inputValue}", int.class);
    ve3 = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpSalary1.inputValue}", int.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    MethodExpression me =
        AdfmfJavaUtilities.getMethodExpression("#{bindings.deleteVOEmployee1.execute}", Object.class,
                                              

new Class[] { });

}

and i am updating the employee using following method

public void copyAndUpdate(ActionEvent actionEvent) {
    System.out.println("In update method");
    AdfELContext adfELContext = AdfmfJavaUtilities.getAdfELContext();
    ValueExpression ve =
        AdfmfJavaUtilities.getValueExpression("#{bindings.DepartmentId.inputValue}", int.class);
    ValueExpression ve3 =
        AdfmfJavaUtilities.getValueExpression("#{bindings.DepartmentId2.inputValue}", int.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    ve = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpAddress.inputValue}", String.class);
    ve3 = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpAddress2.inputValue}", String.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    ve = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpDesignation.inputValue}", String.class);
    ve3 = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpDesignation2.inputValue}", String.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    ve = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpId.inputValue}", int.class);
    ve3 = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpId2.inputValue}", int.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    ve = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpName.inputValue}", String.class);
    ve3 = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpName2.inputValue}", String.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    ve = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpPhone.inputValue}", String.class);
    ve3 = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpPhone2.inputValue}", String.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    ve = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpSalary.inputValue}", int.class);
    ve3 = AdfmfJavaUtilities.getValueExpression("#{bindings.EmpSalary2.inputValue}", int.class);
    ve3.setValue(adfELContext, ve.getValue(adfELContext));
    MethodExpression me =
        AdfmfJavaUtilities.getMethodExpression("#{bindings.Execute.execute}", Object.class,
                                               new Class[] { });
    try{
        me.invoke(adfELContext, new Object[] { });  
    }catch(Exception e){
        System.out.println("Usman: "+e.getMessage()+" and "+e.getLocalizedMessage());
    }
  
   }

I am getting this error while updating

Error invoking method 'execute' in 'class oracle.adfmf.bindings.dbf.AmxActionBinding'

Can anybody help ???

Answers

This discussion has been closed.