Hi all,

This is somewhat complicated so bear with me.

I'm trying to create a bean with a variable number of fields, each which has a name and an associated select box to set various properties. The tml looks something like this:

.....
<tr t: type="AjaxFormLoop" t:sources="residents" t:value="resident" t:encoder="encoder">
   <t:submitnotifier>
       <td><input t:type="TextField" t:value="resident.name" ></td>
      <t:loop source="resident.profiles" value="profile">
<td><select: t:value="profile.selection" model="profile.model" encoder="profile.model" /> </td>
      </t:loop>
   </t:submitnotifier>
</tr>

Resident and profile are standard beans except that resident contains an ArrayList of profiles that is accesses through getProfiles().

This all works pretty well except that Tapestry 5.0.18 tries to serialize the profile bean (I get errors unless I make it extend Serializable) AND it appears to set the selection on another instance of the profile bean. I suspect that tapestry serializes the profile bean, unserializes it to create it's own copy, then changes selection on it's own copy. My bean never sees the updated result.

The work around is ugly - to store the profiles list in the session, the retrieve it and update the actual bean in in the profile.setSelection() method. My question is is this a bug in tapestry or am I doing something wrong? Is there a better way to accomplish this?

Thanks!

Chuck Kring





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to