You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Todd Orr <to...@gmail.com> on 2010/06/29 23:06:14 UTC

AjaxFormLoop AddRow Location

Does anyone know if it is it possible to relocate the p:addrow to somewhere
outside of the loop? It is currently very limiting to be stuck inside a
table, for example. I have a requirement to have the addrow below the table.
Furthermore I need it to also appear above the table. Both of these seem
impossible with ajaxformloop out of the box. I'm afraid that since it has to
be nested (else I get this: "Block parameters are only allowed directly
within component elements") that this requirement is quite impossible.

Thanks
T

Re: AjaxFormLoop AddRow Location

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 30 Jun 2010 12:49:52 -0300, Todd Orr <to...@gmail.com> wrote:

> Thanks Robert. I'll give that a try!
>
> Chris, I'm not sure how that applies. The addrow row is still part of the
> loop and not re-locatable, right?

It must be declared inside the AjaxFormLoop, but you can relocate it  
manipulating the Tapestry DOM. Create a void afterRender(MarkupWriter  
writer) in your page or component and use the writer parameter to  
manipulate the DOM.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: AjaxFormLoop AddRow Location

Posted by Todd Orr <to...@gmail.com>.
Thanks Robert. I'll give that a try!

Chris, I'm not sure how that applies. The addrow row is still part of the
loop and not re-locatable, right?

On Tue, Jun 29, 2010 at 5:44 PM, Robert Zeigler <ro...@scazdl.org> wrote:

> The parameter has to be in the loop. But. :)
> Remember that tapestry renders to a dom.  With a little creativity, you
> could create a component that acts as a "target location" for the rendered
> component.
> And then add a little magic so that, eg, at the end of the page render, you
> grab the rendered /element/ and move it to the target location.  It's less
> than ideal, perhaps, but it works.
>
> Cheers,
>
> Robert
>
> On Jun 29, 2010, at 6/294:06 PM , Todd Orr wrote:
>
> > Does anyone know if it is it possible to relocate the p:addrow to
> somewhere
> > outside of the loop? It is currently very limiting to be stuck inside a
> > table, for example. I have a requirement to have the addrow below the
> table.
> > Furthermore I need it to also appear above the table. Both of these seem
> > impossible with ajaxformloop out of the box. I'm afraid that since it has
> to
> > be nested (else I get this: "Block parameters are only allowed directly
> > within component elements") that this requirement is quite impossible.
> >
> > Thanks
> > T
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: AjaxFormLoop AddRow Location

Posted by Chris Mylonas <ch...@mrvoip.com.au>.
http://tapestry.apache.org/tapestry5.0/tapestry-core/ref/org/apache/tapestry5/corelib/components/AjaxFormLoop.html
I've removed addrow as per the example in the Edit.tml  (you end up  
with only the one addrow)

This is on tapestry-5.0.x though...

NB: Geoff's jumpstart has it - YMMV

On 30/06/2010, at 7:44 AM, Robert Zeigler wrote:

> The parameter has to be in the loop. But. :)
> Remember that tapestry renders to a dom.  With a little creativity,  
> you could create a component that acts as a "target location" for  
> the rendered component.
> And then add a little magic so that, eg, at the end of the page  
> render, you grab the rendered /element/ and move it to the target  
> location.  It's less than ideal, perhaps, but it works.
>
> Cheers,
>
> Robert
>
> On Jun 29, 2010, at 6/294:06 PM , Todd Orr wrote:
>
>> Does anyone know if it is it possible to relocate the p:addrow to  
>> somewhere
>> outside of the loop? It is currently very limiting to be stuck  
>> inside a
>> table, for example. I have a requirement to have the addrow below  
>> the table.
>> Furthermore I need it to also appear above the table. Both of these  
>> seem
>> impossible with ajaxformloop out of the box. I'm afraid that since  
>> it has to
>> be nested (else I get this: "Block parameters are only allowed  
>> directly
>> within component elements") that this requirement is quite  
>> impossible.
>>
>> Thanks
>> T
>
>
> ---------------------------------------------------------------------
> 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: AjaxFormLoop AddRow Location

Posted by Robert Zeigler <ro...@scazdl.org>.
The parameter has to be in the loop. But. :)
Remember that tapestry renders to a dom.  With a little creativity, you could create a component that acts as a "target location" for the rendered component.
And then add a little magic so that, eg, at the end of the page render, you grab the rendered /element/ and move it to the target location.  It's less than ideal, perhaps, but it works.

Cheers,

Robert

On Jun 29, 2010, at 6/294:06 PM , Todd Orr wrote:

> Does anyone know if it is it possible to relocate the p:addrow to somewhere
> outside of the loop? It is currently very limiting to be stuck inside a
> table, for example. I have a requirement to have the addrow below the table.
> Furthermore I need it to also appear above the table. Both of these seem
> impossible with ajaxformloop out of the box. I'm afraid that since it has to
> be nested (else I get this: "Block parameters are only allowed directly
> within component elements") that this requirement is quite impossible.
> 
> Thanks
> T


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