Suggestion:

Add a context binding to loop that can be used to set the "value" binding upon 
link submission. 

 Why:

    As a new user of tapestry, loop actually bit me because I assumed it did 
this already and was surprised in my event handlers when my value binding was 
null. 

Usage Example:

Enclosing Component.tml:

<table class="navigation" 
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

   <tr>
        <t:loop source="list" value="value" context="index">
            <td class="${tabClass}">
                <t:nestedcomponent 
value="value">${value.name}</t:nestedcomponent>
            </td>
        </t:loop>
    </tr>
</table>

  NestedComponent.tml:

      <a class="fancy" t:type="eventlink" event="select"><t:body /></a>


EnclosingComponent.java:

@Property
whatever value;

public Object onSelect()
{
       --- can now do something with "value" because its been set to the same 
thing as it was at generate time based on the index value. 
}

  The "nested component" doesn't have any context, because it doesn't need to 
know how to store the loop value. 



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

Reply via email to