• 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: Adding attributes to markup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding attributes to markup


  • Subject: Re: Adding attributes to markup
  • From: Zak Burke <email@hidden>
  • Date: Fri, 30 Mar 2007 08:37:09 -0400

Webobjects Developer wrote on 3/29/07 5:33 PM:
If I have an HTML template and I want to use a WO component to provide
an attribute on markup, what is the best way to do that?

I've used the following type of construct, but I'm uncomfortable with
it, at best:

<tr<webobject name="ConditionalAltRow"> class="alt"</webobject>>

I use something the following:

<webobject name=fancyTr>...</webobject>

fancyTr: WOGenericContainer
{
	elementName = "tr";
	class = callAMethod;
}

In this case, you'd move your conditional test into callAMethod, and it would return a string depending on the test, e.g. "altRow" or "normalRow". You can add any attributes you want -- class, id, etc.

There is also WOGenericElement for non-container items. For example, if you don't use WOImage but want to add extra attributes to an img tag you could do something like

<webobject name=myImg/>

myImg: WOGenericElement {
	src = methodReturningImgPat;
	alt = methodReturningAltText;
}

zak.
_______________________________________________
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: 
 >Adding attributes to markup (From: "Webobjects Developer" <email@hidden>)

  • Prev by Date: Re: WebObjects classloader fun.
  • Next by Date: Re: Network change
  • Previous by thread: Re: Adding attributes to markup
  • Next by thread: CSS question and YUI
  • Index(es):
    • Date
    • Thread