You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Matias Blasi <ma...@gmail.com> on 2005/09/16 13:45:49 UTC

Particular Foreach use problem

    Hello, we have a design problem.
    We render the UI with our own components model.

    Each UI is represented by a collection of Control's components,
where each of them wrapper the Tapestry one's. Then, whe render them
with in a Foreach.
    While de render-cycle is going, that's all right, but when we need
the value of one Control, out of this cycle, we haven't because of the
Foreach naturality. (eg. if we use de DirectLink of the table-header's
to order it, as the Table's source depends on our Control's binding's
value, wich points to Foreach's value)

Then, I think, the problem is:

Our model, of agrouping etherogeneous components with in a List?
The desicion of use Foreach to render them?
The binding of the Foreach value?

That's the way we bind each Control:

    <component id="fieldsForeach" type="Foreach">
        <binding name="source" expression="layout != null ?
layout.controls : {}"/>
    </component>

    <component id="control" type="ControlComponent">
        <binding name="control" expression="components.fieldsForeach.value"/>
    </component>


Thanks!

-- 
Saludos,
Matias.

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


Re: Particular Foreach use problem

Posted by Kent Tong <ke...@cpttm.org.mo>.
Matias Blasi <matias.blasi <at> gmail.com> writes:
>     While de render-cycle is going, that's all right, but when we need
> the value of one Control, out of this cycle, we haven't because of the
> Foreach naturality. (eg. if we use de DirectLink of the table-header's
> to order it, as the Table's source depends on our Control's binding's
> value, wich points to Foreach's value)

Option 1: Use the Table component instead. It supports sorting out of
the box.

Option 2: To support sorting yourself, you don't need a particular
Control. You only need the column id, not a column value.

--
Author of an e-Book for learning Tapestry (http://www.agileskills2.org/EWDT)


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