I've got a form that allows you to add a number of new users.  When the form
is initially populated, you're coming from a list of email addresses in
another form, so I can populate a bunch of blank users with email addresses
and render the template that way.  Works fine, comes out with a row for each
user, with the email addresses filled in.  As I understand it, since I
haven't written my own encoder, Tapestry will serialize each user into a
hidden field.  A little ugly, but I can live with that for now.

When the form is submitted, since I haven't saved my 'context' anywhere,
it'll come back into existence with a null, or possibly empty collection
reference.  Rather than populating that collection, tapestry just ignores
the fact that it has a bunch of fields, looks at the empty collection,
decides there's nothing to bind to and declares success by calling the
success method, near as I can tell.

I was hoping it would be able to reconsistute the entities from the form
data, which ... I'm now guessing is only true if there are blank entities
waiting to be reconsistuted?

That leaves me with some options:

   1. Persist the transient collection with "flash".  I'd rather not stuff a
   bunch of data in the HTTP session if I can avoid it, but this does seem to
   work.
   2. Persist the /size/ of the collection (flash, or in a page context),
   then populate an empty collection.  This'll use less HTTP Session space (or
   none, if I use onPassivate()), but seems a little unnecessary.
   3. Possibly, if I write my own encoder, this goes away entirely, as I can
   subclass the default and provide an implementation for
   provideMissingObject().  I'm not sure, but that might accomplish what I'm
   looking for.

Anyone already run into this?  Have ideas I haven't thought of on how best
to handle this?

  - Geoffrey
-- 
Geoffrey Wiseman
http://www.geoffreywiseman.ca/

Reply via email to