This is what I do.  Just an similar (but alternate) solution for the same function:

What I do is select the <TR> tag I want to control dynamically and press the "Make Dynamic" button in the WO Builder inspector.  Then bind the bgcolor (or these days the CSS style) that I want to use for the row. Then I bind that to whatever logic I want in the controller class.

Example of my "highlighted" Person from one of my old projects:

-----------------------------------------------
WOD file:
-----------------------------------------------
...
...
PersonHightlighedTR: WOGenericContainer {
bgcolor = personHighlight;
elementName = "TR";
}
...
...

-----------------------------------------------
Java file:
-----------------------------------------------
...
...
    protected Person currentPerson; <<-- Current object in repetition
    protected Person selectedPerson; <<-- The selected object
...
...
    public String personHighlight() {
        return (selectedPerson == currentPerson) ? "#96c8ff" : "#ffffff";
    }
...
...

On Jul 25, 2006, at 11:54 AM, Sacha Michel Mallais wrote:

On Jul 25, 2006, at 7:13 AM, Chip Myers wrote:

I'm currently generating a series of rows within a WORepetition.  The best way to show the structure is as follows:

SELECT     PERSON A    CITY A    STATE A
________________________________________

SELECT     PERSON B    CITY B    STATE B
________________________________________

SELECT     PERSON C    CITY C    STATE C

Upon clicking the 'select' hyperlink, I'd like to highlight this entire row, and only this row.  Unfortunately, I end up highlighting the entire table when the page refreshes itself.  I should add that I have an alternating white and gray row pattern which is generated from a few session variables.  Since this occurs in the session, I've also tried creating a session flag called boolThisRowSelected, to determine when the highlight should occur, but it just hasn't worked yet.

Is there an easy way to highlight just one row within a WORepetition without having to create more session variables?

You can't highlight a row only using WORepetition, nor should you be using the session to store temporary (page-based) information.

I would do the following (note that this assumes you are alright with the page reloading in order to accomplish the row highlight): first, add an index binding to the repetition.  Then, inside the repetition, modify the <tr> tag to be <tr <WEBOBJECT NAME=HighlightConditional>style="background: grey;"</WEBOBJECT>>, where HighlightConditional is a WOConditional bound to a method that returns true only when the selected index equals the current index.  Finally, modify the action method that the SELECT hyperlink is bound to so that it sets the selected index when it is clicked.

HTH,


sacha


-- 
Sacha Michel Mallais             Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65             AIM: smallais


_______________________________________________
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:

This email sent to [EMAIL PROTECTED]

--
Robert Walker



 _______________________________________________
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