2007/1/25, Dave Newton <[EMAIL PROTECTED]>:
From my point of view it seems like your implementation is broken: if you need to create a Customer from an ID passed via a form or URL then you either need to implement Preparable or do the DAO operations in the (in your case) input or save methods.
The DAO operations already do that. The problem happens when the user is *altering* an existing customer (creating a new customer works fine), more specifically when the user is submitting changes from the form to an existing customer object (alongside with an existing id); in that case, the id must be set before getCustomer() is called, otherwise a new customer will be created with zero id. Loading the form with an existing customer works fine. Submitting changes to it is where the problem resides. The idea behind getCustomer() is to abstract the retrieving of the customer object wherever it's called along the action's code so that I don't have to care about whether it's an existing customer or not. Implementing Preparable does not seem to solve the problem because the parameters are set before the prepare() method is invoked. Célio. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]