To anyone who can help,
 
Last weekend I managed to successfully use intake to validate and empty
form i.e. a new record in the database. Now I have managed to use
criteria to select a certain record from the database and insert it into
context and then map the values to the form (This is so I can edit a
record in the database and still use intake to validate). Where I am
having problems is with the Update I have copied and my method below. I
noticed in the html that the $intake.declareGroups() method adds a
hidden field with the value being the primary key of the record being
updated so I used that for the "intake.get" method. Everything seems to
execute smoothly but no update goes through to the database.
 
public void doUpdate(RunData data, Context context)
    throws Exception
{
    IntakeTool intake = (IntakeTool)context.get("intake");
    Group group = intake.get("Customerentry",
data.getParameters().getString("customerentry"));
    if (group.isAllValid())
    {
        Customer customer = new Customer();
        group.setProperties(customer);
        customer.setModified(true);
        customer.setNew(false);
        customer.save();
 
data.setScreenTemplate(data.getParameters().getString("nextTemplate"));
    }
}
 
Any help is much appreciated.
 
Regards,
 
Stuart Townhill.

Reply via email to