Re: Tags inside tags [was: Re: WebObjects 5.4 is out.]
Re: Tags inside tags [was: Re: WebObjects 5.4 is out.]
- Subject: Re: Tags inside tags [was: Re: WebObjects 5.4 is out.]
- From: Paul Hoadley <email@hidden>
- Date: Sun, 4 Nov 2007 14:51:50 +1030
On 03/11/2007, at 7:33 PM, Paul Hoadley wrote: On 27/10/2007, at 5:50 AM, Mike Schrag wrote: 2) Tags inside of tags (<td class = "<webobject name = "SomeClass"/>">). This is EVIL. The WOLips validator has also been yelling at you about this for months now, and that was very intentional. If you listened to it, you're in a much better position for 5.4. There is no automatic fix for this ... In fact, I would not be surprised that this will probably whack out the WOLips autoformatter and wobuilder cleaner.
As an aside to the main thread, what's the WO idiom for getting around this? While WOLips accepts this:
<link href='<webobject name="myCSS"/>' rel="stylesheet" type="text/css"/>
(where myCSS refers to a WOResourceURL), and it builds and runs, it makes the XML purist inside me cringe. JSP, for example, has the jsp:element/jsp:attribute elements with which you can build up an output element and its attributes dynamically. Is there something analogous in WO?
Thanks for replies from Andrew, Miguel, Guido.
I started with:
and:
css : WOGenericElement { elementName = "link"; href = cssHref; rel = "stylesheet"; type = "text/css"; }
but it wasn't clear to me how to get the WOResourceURL I had been using originally bound to 'href'. I found the answer in the archives:
So I added a method to the Java:
public String cssHref() { WOResourceManager rm = application().resourceManager(); return rm.urlForResourceNamed("SMBS.css", null, null, context().request()); }
Works as intended, and the XML no longer hurts my eyes. :-)
|
_______________________________________________
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