Hi

Putting Thiago's answer into code

<div t:type='zone' t:id='myFormZone'>
   <form t:type='Form' t:zone='myFormZone'>
   </form>
</div>

@InjectComponent
private Zone myFormZone;

@OnEvent(EventConstants.SUBMIT)
Object submit(){
   return myFormZone.getBody();
}

Not sure why you are using a block. 

regards
Taha


On Nov 26, 2011, at 8:43 AM, Greg Pagendam-Turner wrote:

> On 26/11/2011 12:21 PM, Thiago H. de Paula Figueiredo wrote:
>> On Sat, 26 Nov 2011 00:10:20 -0200, Greg Pagendam-Turner 
>> <g...@liftyourgame.com> wrote:
>> 
>>> Hi,
>> 
>> Hi!
>> 
>>> How do I write code for a page that contains a form which replaces itself 
>>> via Ajax once a certain event has occurred?
>> 
>> The simplest way is to put the form inside a Zone and make the form's zone 
>> update point to it. When the form is submitted, return zone.getBody(), where 
>> zone is @InjectComponent private Zone zone.
>> 
> Thanks for the quick response Thiago.
> 
> It seems I only need one form. I don't need a form for the trigger event.
> 
> If I put a form in a block and return that block I get:
> 
> "Form components may not be placed inside other Form components."
> 
> Even though there is no form in a form as the only form is the one returned 
> by the block.
> 
> 
> Regards,
> 
> Greg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


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

Reply via email to