Kindly help me on saving/insert new data in table.
error–>1001
msg–>Cannot update object without any properties: flatno
detila–>null
Backendless.Persistence.save( Complaintdtl, new AsyncCallback<Complaintdtl>() {
public void handleResponse( Complaintdtl response )
{
// new complaint instance has been saved
Toast.makeText( getApplicationContext(), “Complaint Registered Successfully”, Toast.LENGTH_SHORT ).show();
}
public void handleFault( BackendlessFault fault )
{
// an error has occurred, the error code can be retrieved with fault.getCode()
Toast.makeText( getApplicationContext(),fault.getCode(), Toast.LENGTH_SHORT ).show();
}
});
private View.OnClickListener sendButtonListener = new View.OnClickListener()
{ @Override
public void onClick( View view )
{
Complaintdtl complaintdtl = new Complaintdtl();
complaintdtl.setcomplaint(complaintmsg.getText());
complaintdtl.setflatno(flatno.getText());
complaintdtl.setname(fname.getText());
Backendless.Persistence.save( complaintdtl, new AsyncCallback<Complaintdtl>() {
public void handleResponse( Complaintdtl response )
{
// new complaint instance has been saved
Toast.makeText( getApplicationContext(), "Complaint Registered Successfully", Toast.LENGTH_SHORT ).show();
}
public void handleFault( BackendlessFault fault )
{
// an error has occurred, the error code can be retrieved with fault.getCode()
Toast.makeText( getApplicationContext(),fault.getCode(), Toast.LENGTH_SHORT ).show();
System.out.println("---error-- "+fault.getCode()+"---msg-->"+fault.getMessage()+"---detila-->"+fault.getDetail());
}
});
}
};
This shows that the values can be set through setters. However, when an object is serialized to server, setters do nothing, so this essentially does not answer my question.
First of all, your class doesn’t have default no-argument constructor.
Second, it has field of “Editable” class, which is not supported. You can use only primitive types, Strings, and your custom classes ( which also must have default constructor and all setters and getters ). Avoid using any other classes.
best regards,
Alex