Lukasz Lenart wrote:

You should use prepare() to prepopulate lists / comboboxs/ etc not to
create your domain objects.


Regards
The OP's approach is appropriate when using the param-prepare-params pattern. Sometimes it's essential that the domain objects are instantiated/loaded in a prepare method prior to setting their params. eg. #1. if it's impossible for S2 to instantiate it (when there's no default constructor or an unknown concrete type). eg. #2.where a parameter is required to load the domain object prior to setting its it's params

For the OP:
You haven't indicated whether you're using a getter (getProduct()) or ModelDriven<Product>. It appears to me that your problem is unrelated to the paramsPrepareParams stack and more related to your parameters name.

The first invocation of the params interceptor will set all params of your action (productId, name, color etc). In this case, a Product does not exist but the productId is set.
The prepare method is invoked and your Product created loaded.
The second invocation of the params interceptor will set all params of your action again (productid, name, color). In this case a Product does exist, but you're not setting its own parameters.

I suspect you haven't applied the ModelDriven<Product> interface. You need to use that if you want to call your parameter "name".

Otherwise you need a getProduct() method with param names such as "product.name" and "product.color".

regards,
Jeromy Evans


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to