Here's how I do it.

First, add the "value" parameter in your component, files:
<component id="files" type="Foreach">
    <binding name="source" property-path="..."/>
    <binding name="value" property-path="file"/>
</component>

In the component implementation, add a mutator
for property file:
SomeType _file;
  :
public void setFile(SomeType file){
    _file = file;
}

Also add a accessor for file context:
public String[] getFileContext(){
    return new String[]{_file.id, _profile.id};
}

And your editFile component can be modified as:
<component id="editFile" type="Direct"> 
    <binding name="listener" property-path="listeners.editFile"/> 
    <binding name="context" property-path="fileContext"/> 
</component>

Hope this helps.

dright

-----Original Message-----
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]On Behalf Of Phil Surette
Sent: Friday, May 03, 2002 10:15 PM
To: Tapestry Developer (E-mail)
Subject: [Tapestry-developer] multi-value contexts for Direct components


How do you pass multiple values to a Direct's context? 
I've tried each of the following but in both cases the corresponding editFile method 
gets only one value. 
  <component id="editFile" type="Direct"> 
    <binding name="listener" property-path="listeners.editFile"/> 
    <binding name="context" property-path="components.files.value.id"/> 
    <binding name="context" property-path="profile.id"/> 
  </component> 
  <component id="editFile" type="Direct"> 
    <binding name="listener" property-path="listeners.editFile"/> 
    <binding name="context" property-path="components.files.value.id,profile.id"/> 
  </component> 
re: brief description of how we're using tapestry, I'm not sure how much I can say, 
will get back to you when possible. 

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to