On Jul 25, 2006, at 9:35 AM, Chip Myers wrote:

Sacha: you mentioned

         Then, inside the repetition, modify the tag to be
         NAME=HighlightConditional>style="background: grey;">,
where HighlightConditional is a WOConditional bound to a method that returns true only when the selected index equals the current index.

How do I call this method to check for when the selected index equals the current index? Should I place a WOGenericElement which calls the method inside my row, so that the check can be performed on each iteration of the repetition? I have a feeling that there are more efficient ways, I just don't know them yet.

That's what the WOConditional is for. The WOConditional is inside the WORepetition, so it will get evaluated once each time through the repetition. Most rows, the condition will evaluate to false, and therefore the style="background: grey;" will not show up; on the row that the selected index == the repetition index, the WOConditional will evaluate to true and that particular row will have style="background: grey;".

So the WOConditional should have its condition binding set to, say, isSelected(). In isSelected(), simply return repetitionIndex == selectedIndex; where repetitionIndex is an ivar bound to the WORepetition's index binding and selectedIndex gets set by your SELECT action method.

Does that make more sense?


sacha


--
Sacha Michel Mallais             Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65             AIM: smallais
So it doesn't mess up the flow of reading.
> How come?
> > I prefer to reply inline.
> > > What do you do instead?
> > > > No.
> > > > > Do you like top-posting?



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to