You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by George Christman <gc...@cardaddy.com> on 2011/11/01 18:57:46 UTC
Update Zone in form1 from form2
I have a form that contains two form fields, form1 and form2
Form1 contains all the main form data and form2 is a popup box surrounded by
a zone.
Form2 popup box zone is triggered from a select menu within form1. The
select menu contains an add new value option.
When the popup box zone is triggered, the popup box appears with the addrow
component.
When you add a new row of data to the popup box and hit submit, I'm looking
to close out the box and update the select menu within form1.
The easiest way to handle this would be to just commit it to the database,
but that isn't an option here, so I would need to update the session object.
I'm using a multiZone component which seems to work find until it reloads
the select menu which is also contained within a zone. I think it's removing
the select menu zone from it's current location and giving me the following
exception.
purchaserequestform.select must be enclosed by a Form component.
If anybody has any suggestions, it would be greatly appriciated. I'm not
sure if I zone component can be used in such away.
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Update-Zone-in-form1-from-form2-tp4955889p4955889.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Update Zone in form1 from form2
Posted by George Christman <gc...@cardaddy.com>.
Hi Steve, Thanks for the reply.. Yes they are injected components, however
appending getBody() didn't seem to have any affect on the zone reload.
I notice when trigger the zone refresh form 2 and refresh the zone in form
1, it tries to reload the zone from form1 in form2 before it reloads in
form1. This seems to be whats causing the select menu to throw the exception
it must be contained within a form.
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Update-Zone-in-form1-from-form2-tp4955889p4958022.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Update Zone in form1 from form2
Posted by Steve Eynon <st...@alienfactory.co.uk>.
Not too sure but... if zoneOne and zoneTwo are injected components,
try returning zone.getBody() instead - as in:
Object onSelectedFromUpdate() {
return new MultiZoneUpdate("zoneOne",
zoneOne.getBody()).add("zoneTwo", zoneTwo.getBody());
}
Steve.
On 2 November 2011 03:27, George Christman <gc...@cardaddy.com> wrote:
> I simplified my problem with a small code example. Hopefully this helps.
>
>
> <t:Form t:id="form1">
> <t:Zone t:id="zoneOne" id="zoneOne">
> This select menu will trigger the popup box.
> <t:Select t:mixins="zoneUpdater" t:clientEvent="change"
> t:event="newFundingChanged" t:context="lineItemFunding.tempId"
> value="lineItemFunding.funding" model="fundingModel"
> encoder="selectEncoder" zoneupdater.zone="fundingZone"/>
>
> </t:Zone>
> </t:Form>
>
> This is the popup box that contains a text field which will update the
> select menu in form 1 on submit
> <t:Zone t:id="zoneTwo" id="zoneTwo" update="fade" visible="false">
> <t:Form t:id="form2" t:zone="zoneTwo">
> <t:TextField/>
> <t:Submit>
> </t:Form>
> </t:Zone>
>
>
> Object onSelectedFromUpdate() {
> return new MultiZoneUpdate("zoneOne", zoneOne).add("zoneTwo",
> zoneTwo);
> }
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Update-Zone-in-form1-from-form2-tp4955889p4956100.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Update Zone in form1 from form2
Posted by George Christman <gc...@cardaddy.com>.
I simplified my problem with a small code example. Hopefully this helps.
<t:Form t:id="form1">
<t:Zone t:id="zoneOne" id="zoneOne">
This select menu will trigger the popup box.
<t:Select t:mixins="zoneUpdater" t:clientEvent="change"
t:event="newFundingChanged" t:context="lineItemFunding.tempId"
value="lineItemFunding.funding" model="fundingModel"
encoder="selectEncoder" zoneupdater.zone="fundingZone"/>
</t:Zone>
</t:Form>
This is the popup box that contains a text field which will update the
select menu in form 1 on submit
<t:Zone t:id="zoneTwo" id="zoneTwo" update="fade" visible="false">
<t:Form t:id="form2" t:zone="zoneTwo">
<t:TextField/>
<t:Submit>
</t:Form>
</t:Zone>
Object onSelectedFromUpdate() {
return new MultiZoneUpdate("zoneOne", zoneOne).add("zoneTwo",
zoneTwo);
}
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Update-Zone-in-form1-from-form2-tp4955889p4956100.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org