The origin of the problem is that the context passed to ZoneUpdater has only one piece of information - the value of the option you selected. No other context is received. So the server-side must get the rest of the context from either (a) the session, eg. by saving country and city in the session on output by using @Persist; or (b) saving them in a conversation persisted in the session or the database, which avoids the side-effects of @Persist; or (c) including the context in the value of the option selected, eg. when city option "San Francisco" is chosen, the value passed could be "USA | San Francisco".
Are there any other alternatives? Well maybe there's a way to use ZoneUpdater's context parameter, but I'm not sure. So (c) is looking pretty good. HTH, Geoff On 31/03/2010, at 6:53 AM, Everton Agner wrote: > Just to show the example cleaner... > > > <div t:id="updateZone" t:type="zone"> > > <t:form ... /> > <p:country> > <!-- The nested combo that refresh the "cities" combo by the > "ZoneUpdater" mixin--> > </p:country> > <p:city> > <!-- The combo which it's content it's updated by the change of the > Country combo --> > </p:city> > <p:name> > <t:label ... /> > <t:textfield id="name" ... /> > </p:name> > ... > </t:form> > > > <div t:id="updateZone" t:type="zone"> > > > So, since everything is inside the "updateZone" combo, every field is > refreshed and lost their values. > > > Thanks! > > - Everton > > > > ________________________________ > De: Everton Agner <everton_ag...@yahoo.com.br> > Para: Tapestry Users <users@tapestry.apache.org> > Enviadas: Terça-feira, 30 de Março de 2010 16:39:37 > Assunto: [T5.1] Best approach to Nested Combos on Forms > > > Hi, > > I'd like to know which is the cleaner way to work with nesting on Forms on T5. > > I saw a project with the ZoneUpdater mixin... But, to preserve the values > from the Form - to reload them after the refresh - it needed to @Persist the > values and update them everytime the fields lost their focus. > > Example: > > <t:textfield clientEvent="change" event="changeName" > zone="updateZone" t:mixins="zoneUpdater" > t:value="current.name" t:id="name" > t:validate="required" size="30"/> > > So, there is a "changeName()" method in the Page Class to update the "name" > field value - which is @Persist'ed. > > I don't like the way it sounds. Is there another way to achieve the nesting > and preserve the Form fields values? > > Thanks > > - Everton > > ________________________________ > Veja quais são os assuntos do momento no Yahoo! + Buscados: Top 10 - > Celebridades - Música - Esportes > > > > ____________________________________________________________________________________ > Veja quais são os assuntos do momento no Yahoo! +Buscados > http://br.maisbuscados.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org