• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Newbie question about highlighting rows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie question about highlighting rows


  • Subject: Re: Newbie question about highlighting rows
  • From: Sacha Michel Mallais <email@hidden>
  • Date: Tue, 25 Jul 2006 09:56:45 -0700

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      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Newbie question about highlighting rows (From: Chip Myers <email@hidden>)

  • Prev by Date: Re: Newbie question about highlighting rows
  • Next by Date: Web Services - A newbie
  • Previous by thread: Re: Newbie question about highlighting rows
  • Next by thread: Re: Newbie question about highlighting rows
  • Index(es):
    • Date
    • Thread