I guess it is not surprising that I would do a completely orthogonal thing ;-)

ActionForm is an I/O buffer, it aggregates BO/DTO + lists/options for
selectboxes + error messages for the aggregated BO. BO exposes
properties that are editable and "persistable". BO does not care about
option lists because actual BO or database row contains only one
value. BO is a nested property within session-scoped ActionForm.
Whenever error is made and page is reloaded, or a user just navigates
a page, it displays BO in its current state and associated messages.

ActionForm should be removed from session manually, this is the price
to pay. I thought about automating this, but Hubert pointed out that a
user can open several browser windows for one app, so I gave up on
this.

Storing list in the session (session-scoped ActionForm,
poteito-potahto) also helps in case the option list itself was changed
down on the business/persistent level, so a new instance in request
would not match previous one, and current selection would get screwed
up.

Actually, if the option list is changed very rarely, I'd put it into
app context. If it is changed more frequently, then into session
scope, to isolate user session from potential changes.

Michael.

On 12/26/05, Rick Reumann <[EMAIL PROTECTED]> wrote:
> I would use the Request for such a List and wouldn't even bother putting it
> in the ActionForm (unless of course the list is something the user is
> actually editing, then yes, you'd add that List as an ActionForm property).
> I try to keep my ActionForm with 'only' properties that the user can edit -
> nothing more. So for example if you were displaying a list of favorite cars
> for the user to pick from I would just put that list in the Request and the
> "selectedCar" would be the property you would concern youself with in the
> ActionForm. (If you are worried about performance, I'd put the performance
> concerns on the backend.. let the back end take care of any list caching.)
>
> On 12/26/05, Paul Benedict <[EMAIL PROTECTED]> wrote:
> >
> > I am going to ask a related question... so take your best shot :-)
> >
> > I have an edit form in which I have to load a list from the database. The
> > list is actually based
> > on locale. What's the best solution here? I am using real action forms -
> > not that dynafluff stuff
> > ;) Is it to simply make my form session scope and attach the list to my
> > form?
> >
> > THANKS!
> > Paul

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

Reply via email to