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:
<webobject name="css"/>
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:
http://lists.apple.com/archives/Webobjects-dev/2004/Apr/msg00687.html
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. :-)
--
Paul.
w http://logicsquad.net/
h http://paul.hoadley.name/
_______________________________________________
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 [EMAIL PROTECTED]