• 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: Generic conditional WOHyperlink
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generic conditional WOHyperlink


  • Subject: Re: Generic conditional WOHyperlink
  • From: Chuck Hill <email@hidden>
  • Date: Mon, 12 Mar 2007 15:28:19 -0700


On Mar 12, 2007, at 2:30 PM, David Holt wrote:

Thanks Chuck,

On 12 Mar 2007, at 1:42 PM, Chuck Hill wrote:


On Mar 12, 2007, at 11:40 AM, David Holt wrote:

I have a tabbed navigation component with several WOHyperlinks each bound to a different action method.

I have created a generic WOHyperlink that adds a class binding bound to a cssClass method that checks the link's location and returns the CSS class as a string based on whether the component is on the link's "home" tab or not.

Why not just use a regular WOHyperlink and put the class selecting logic in the tabbed navigation component? It seems like that is where this code belongs.

This didn't work for me. In my WOHyperlink I had "class" bound to the method cssClass:


    public String cssClass()
    {
        if (isOnTab()) {
			cssClass = "subnavhighlight";
		} else {
			cssClass = "subnav";
		}
		return cssClass;
    }

	public boolean isOnTab()
    {
		if (currentTab.equals(homeTab)) {
			isOnTab = true;
		} else {
			isOnTab = false;
		}

		return isOnTab;
    }




currentTab is in the navigation component with its value taken from the parent (^currentTab)

So the page sets that?


I added the homeTab binding to WOHyperlink bind it to a String.

Now you lost me. Why did you do that? What are you trying to achieve?


homeTab always resolves to null so the isOnTab() method always resolves to false.

OK, let me try to understand this. You have something like this in your WOD?


SomeLink: WOHyperlink {
    action = something;
    class = cssClass;
    homeTab = "Inventory";
}

Is that right? This is going to produce this html:
<a href="...." class="subnav" homeTab = "Inventory">...</a>
It is NOT going to set homeTab on the parent class to "Inventory" if that is what you were thinking.


Or am I totally off track?

Chuck

--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
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


  • Follow-Ups:
    • Re: Generic conditional WOHyperlink
      • From: David Holt <email@hidden>
References: 
 >Generic conditional WOHyperlink (From: David Holt <email@hidden>)
 >Re: Generic conditional WOHyperlink (From: Chuck Hill <email@hidden>)
 >Re: Generic conditional WOHyperlink (From: David Holt <email@hidden>)

  • Prev by Date: Re: NSArray.subList() implementation broken?
  • Next by Date: Re: Generic conditional WOHyperlink
  • Previous by thread: Re: Generic conditional WOHyperlink
  • Next by thread: Re: Generic conditional WOHyperlink
  • Index(es):
    • Date
    • Thread