Re: WOComponent children
Re: WOComponent children
- Subject: Re: WOComponent children
- From: email@hidden
- Date: Mon, 7 Jan 2008 13:52:54 -0500
Hi Lachlan, you have some good ideas.
1) Scan all java WOComponent files at application
launch and make a list of needed resources:
This is cool. The one drawback is that every page
you go to would have lots of JS and CSS files in the head tag, even if
there is no possibility of using a given file on that particular page.
It's not so bad though because those resources between the head tags get
cached and will be used sooner or later anyway if the user continues for
any meaningful length of time. I'm not sure how to immediately go about
scanning all the java files, have you implemented anything like that before?
I think in the meantime I'm going to use an approach similar to this but
instead of scanning all the java sources I'm just going to make "appendResourceInHead()"
a static method on all the subComponents and just manually call all these
from the pageWrapper.
2) Augmenting the UserInfo dictionary of WOResponse:
Unfortunately this won't work because not all the
needed elements would be questioned to give their input to the augmented
UserInfo dictionary.
3) Dynamically load _javascript_ or modify the DOM:
This probably can work. Mike Schrag has also alluded
to this in the past as a possible solution. Ideally you could modify the
contents between the "head" tags in the DOM and hopefully most
browsers would understand that you inserted a JS or CSS reference and load
them on the fly, possibly even utilizing the local browser cache. But this
would have to be tested and might not work on a "Opera" for example.
Another angle would be to always check for the existence of a function
or _javascript_ object before blindly using it. If it is not defined, then
you could make an Ajax call and download the needed file on the fly, possibly
using "evaluate" to load the needed functionality. This would
not make use of the cache but would only happen at most once per page.
While this is all perhaps possible, it would take a bit of experimentation
and may not be totally cross browser compatible.
-- Aaron _______________________________________________
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