ok, i figured out a way to do what i want to accomplish - and i think i
mislead (myself included) the first time around (apologies).
I think this will work for what i want:
> <component id="boxesList" type="Foreach">
> <binding name="source" value="htmlBoxesAsStringsList" />
> <binding name="index" value="boxesIndex" />
> </component>
> .....
> .....
> <component id="textDisplayed" type="CustomComp">
> <binding name="customBinding" expression="method(boxesIndex)"
/>
> </component>
I never really wanted the value binding of the Foreach in the first place.
I'm simply going to try to wrap the CustomComp in the foreach.
Much simpler than i planned.....
thanks E,
marc
----- Forwarded by Marc Smith/NYC/NHL on 01/14/03 12:57 PM -----
Marc Smith
To:
[EMAIL PROTECTED]
01/14/03 12:29 PM cc:
Subject: RE: [Tapestry-developer]
Foreach where value is another component(Document
link: Marc Smith)
e,
My aim is for something like this:
> <component id="textDisplayed" type="CustomComp">
> <binding name="customBinding" expression
="valueBasedOnIndex(components.foreach.index)" />
> </component>
I want each iteration to come up with a completely different component, and
extract from there.....
I'm not too bent on using the index, if i can do it another way.
marc
"Schneider,
Eric" To: "'[EMAIL PROTECTED]'"
<[EMAIL PROTECTED]>
<eschneider@tiaa cc:
-cref.org> Subject: RE: [Tapestry-developer]
Foreach where value is another component
01/14/03 12:04
PM
Hahahah. Sorry dude. I totally misread your original post.
So, why do you need a different component for each index?
e.
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 14, 2003 11:47 AM
> To: [EMAIL PROTECTED]
> Subject: [Tapestry-developer] Foreach where value is another component
>
>
> Newbie to Tapestry, any help would be much appreciated.
> I have a Foreach component, and want the value binding to be bound to
> another component on the same page.
> Here's what i want to achieve:
> <component id="boxesList" type="Foreach">
> <binding name="source" value="htmlBoxesAsStringsList" />
> <binding name="value" value="components.textDisplayed" />
> <binding name="index" value="boxesIndex" />
> </component>
> .....
> .....
> <component id="textDisplayed" type="Insert">
> <binding name="value" expression="insertText" />
> </component>
>
> Currently, getInsertText() in my code returns the same String
> every time,
> BUT my goal is return something different based on the
> Foreach's index.
> AND, my ultimate goal is to not use an "Insert" component,
> but a much more
> complex custom component that still bases its actions on the Foreach's
> index.
>
> The exception being thrown is a
> net.sf.tapestry.ReadOnlyBindingException
> which seems somewhat *reasonable*.......
> I feel the answer is right under my nose, and i'll kick
> myself later for
> this, but any advice would be greatly appreciated.
>
> Thanks,
> marc
>
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by: FREE SSL Guide from Thawte
> are you planning your Web Server Security? Click here to get a FREE
> Thawte SSL guide and find the answers to all your SSL
> security issues.
> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
> _______________________________________________
> Tapestry-developer mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer
>
**********************************************************************
This message, including any attachments, contains confidential information
intended for a specific individual and purpose, and is protected by law.
If you are not the intended recipient, please contact sender immediately by
reply e-mail and destroy all copies. You are hereby notified that any
disclosure, copying, or distribution of this message, or the taking of any
action based on it, is strictly prohibited.
TIAA-CREF
**********************************************************************
-------------------------------------------------------
This SF.NET email is sponsored by: FREE SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer