You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "CRANFORD, CHRIS" <Ch...@setech.com> on 2010/01/07 22:19:22 UTC

Action Approach

All - 

I am working on an action that takes a set of input and forwards the
user to a web page that contains a form with a layout as follows:

           Active  Primary
Catalog1    [  ]    [  ]
Catalog2    [  ]    [  ]
Catalog3    [  ]    [  ]

In order to to capture the changes to the checkbox values for both
active and primary for each catalog entry listed, what is the best
approach for mapping this back into the action so that I can update my
hibernate model objects.

Thanks
Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action Approach

Posted by Gabriel Belingueres <be...@gmail.com>.
I think the answer would depend of what your model objects look like.

If your Catalog object have 2 boolean variables (active and primary)
then holding a Map<CatalogPrimaryKey,Catalog> on your action (session
scoped) is a straightforward solution. (name your checkbox
"catalogMap[pk].active" and "catalogMap[pk].primary")

If this is not the case, then your action could hold 2
Map<CatalogPrimaryKey,Boolean> activeMap and primaryMap, and naming
your checkboxes like "activeMap[key]" will do.

2010/1/7 CRANFORD, CHRIS <Ch...@setech.com>:
> All -
>
> I am working on an action that takes a set of input and forwards the
> user to a web page that contains a form with a layout as follows:
>
>           Active  Primary
> Catalog1    [  ]    [  ]
> Catalog2    [  ]    [  ]
> Catalog3    [  ]    [  ]
>
> In order to to capture the changes to the checkbox values for both
> active and primary for each catalog entry listed, what is the best
> approach for mapping this back into the action so that I can update my
> hibernate model objects.
>
> Thanks
> Chris
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org