Re: ADF Faces javascript rendering

2006-02-22 Thread Werner Punz
Laurie Harper schrieb:
 The Tomahawk components 'inject' Javascript file references into the
 head section of the response by using a filter to buffer and
 post-process the response. I'm assuming ADF Faces has some mechanism for
 injecting Javascript too, but I can't seem to track it down...
 
 I've found the code that handles serving static resources, just not the
 code responsible for injecting references to Javascript files. The
 reason I'm looking for it is so I can make a component library I'm
 working on use it.
 
 Can anyone give me a pointer to the right area in the ADF Faces code, or
 even better a quick explanation of how to use it to do what I want?
 
 Thanks,
 
Laurie, cannot help you there, but a minor sidequestion, did you use my
dojo hooks I provided in the sandbox?
If yes please give me feedback if you need something changed
or added, now is a perfect time for doing it, the whole dojo base will
be moved into Tomahawk after 1.1.2, and then it will be much harder to
break existing interfaces if needed.
The reason why I am asking is that I need comments and feedback from
people who do serious component development so that I get more insight
on what is needed (for now I only have the stuff in I need)



Re: ADF Faces javascript rendering

2006-02-22 Thread Laurie Harper

Werner Punz wrote:

Laurie, cannot help you there, but a minor sidequestion, did you use my
dojo hooks I provided in the sandbox?
If yes please give me feedback if you need something changed
or added, now is a perfect time for doing it, the whole dojo base will
be moved into Tomahawk after 1.1.2, and then it will be much harder to
break existing interfaces if needed.
The reason why I am asking is that I need comments and feedback from
people who do serious component development so that I get more insight
on what is needed (for now I only have the stuff in I need)


I had a look through (some of) your Dojo-related code, but haven't used 
it directly. As you know, I have code of my own in this area ;-)


L.



Re: ADF Faces javascript rendering

2006-02-22 Thread Mike Kienenberger
Have you looked at this?

http://wiki.apache.org/myfaces/External_Resources


On 2/22/06, Laurie Harper [EMAIL PROTECTED] wrote:
 The Tomahawk components 'inject' Javascript file references into the
 head section of the response by using a filter to buffer and
 post-process the response. I'm assuming ADF Faces has some mechanism for
 injecting Javascript too, but I can't seem to track it down...

 I've found the code that handles serving static resources, just not the
 code responsible for injecting references to Javascript files. The
 reason I'm looking for it is so I can make a component library I'm
 working on use it.

 Can anyone give me a pointer to the right area in the ADF Faces code, or
 even better a quick explanation of how to use it to do what I want?

 Thanks,

 L.




Re: ADF Faces javascript rendering

2006-02-22 Thread Adam Winer
Laurie,

We use a Scriptlet API down in :
 oracle.adfinternal.view.faces.renderkit.core.xhtml.jsLibs
... the basic gist of which is that a Renderer can say
hey, I need function foo(), and the Scriptlet API
figures out whether that means importing a lib, or
writing out an in-place script, and if so, whether it's already
been rendered once.

Instead of using a Filter to inject into head,  we currently
blow off the notion that script elements can only be in
head.  Evil, perhaps, but there's not a browser that really
cares, and practical considerations trumped HTML purity.
But since the details are hidden inside of the Scriptlets, they
could instead just add the scripts to a list that later gets
injected by a Filter.

Note that this code is currently in adfinternal, which
means that it is not a public API, and is not considered
legit for code external to ADF Faces to extend.  One
of my major goals for the ADF Faces codebase is to
extract a public API from the current adfinternal rendering
APIs, which reminds me I need to post some support
for John's api/impl split e-mail... :)

-- Adam


On 2/21/06, Laurie Harper [EMAIL PROTECTED] wrote:
 The Tomahawk components 'inject' Javascript file references into the
 head section of the response by using a filter to buffer and
 post-process the response. I'm assuming ADF Faces has some mechanism for
 injecting Javascript too, but I can't seem to track it down...

 I've found the code that handles serving static resources, just not the
 code responsible for injecting references to Javascript files. The
 reason I'm looking for it is so I can make a component library I'm
 working on use it.

 Can anyone give me a pointer to the right area in the ADF Faces code, or
 even better a quick explanation of how to use it to do what I want?

 Thanks,

 L.




Re: ADF Faces javascript rendering

2006-02-22 Thread Laurie Harper
Mike, thanks for the link. Yes, I'm familiar with the AddResources stuff 
in Tomahawk, but was looking for the equivalent functionality in ADF 
Faces so I can inter-operate with either.


L.

Mike Kienenberger wrote:

Have you looked at this?

http://wiki.apache.org/myfaces/External_Resources


On 2/22/06, Laurie Harper [EMAIL PROTECTED] wrote:

The Tomahawk components 'inject' Javascript file references into the
head section of the response by using a filter to buffer and
post-process the response. I'm assuming ADF Faces has some mechanism for
injecting Javascript too, but I can't seem to track it down...

I've found the code that handles serving static resources, just not the
code responsible for injecting references to Javascript files. The
reason I'm looking for it is so I can make a component library I'm
working on use it.

Can anyone give me a pointer to the right area in the ADF Faces code, or
even better a quick explanation of how to use it to do what I want?

Thanks,

L.








Re: ADF Faces javascript rendering

2006-02-22 Thread Rogers Reilly

Werner Punz wrote:


Laurie Harper schrieb:
 


The Tomahawk components 'inject' Javascript file references into the
head section of the response by using a filter to buffer and
post-process the response. I'm assuming ADF Faces has some mechanism for
injecting Javascript too, but I can't seem to track it down...

I've found the code that handles serving static resources, just not the
code responsible for injecting references to Javascript files. The
reason I'm looking for it is so I can make a component library I'm
working on use it.

Can anyone give me a pointer to the right area in the ADF Faces code, or
even better a quick explanation of how to use it to do what I want?

Thanks,

   


Laurie, cannot help you there, but a minor sidequestion, did you use my
dojo hooks I provided in the sandbox?
If yes please give me feedback if you need something changed
or added, now is a perfect time for doing it, the whole dojo base will
be moved into Tomahawk after 1.1.2, and then it will be much harder to
break existing interfaces if needed.
The reason why I am asking is that I need comments and feedback from
people who do serious component development so that I get more insight
on what is needed (for now I only have the stuff in I need)



 

I haven't made a full-blown Dojo component yet, but I have used the 
af:inputHidden value=#{backingBean.var} id=myId / component of ADF 
with Dojo widgets, passing the widget a simple onFoo function along the 
lines of 'document.getElementById('myId').value = 
MyWidget.getSomeValue();' to sync up the widget with JSF.  (note- you 
can also submit a display:none CommandButton in this onFoo function, and 
do a Partial Page Refresh ... very cool!)


Now, I've just done this hookup with a Facelet--which works fine for 
now, can even be packaged into a tag if I want--and not an actual 
component, so I can't say what I'd want from a platform perspective to 
facilitate this kind of simple Dojo/JS-to-JSF integration.  (toDoList[0] 
= learn custom components)


Did want to share the pattern, though, as it seems like the kind of 
thing MyFaces could facilitate.


Re: ADF Faces javascript rendering

2006-02-22 Thread Laurie Harper

Mike Kienenberger wrote:

On 2/22/06, Laurie Harper [EMAIL PROTECTED] wrote:

Maybe it would make sense to move Tomahawk's AddResources / Filter based
stuff into commons so it can be re-used across Tomahawk, ADFF, Tobago
and other component libraries?


I don't see any reason why we can't move that stuff into commons (and
actually, I figured it was already in commons), now that we have a
commons jar.   It's intended as an end-user API.  Please open a JIRA
issue so we don't forget. You've probably noticed that we're still
discussing how commons is going to work :)

Maybe it hasn't been done up to this point because the extensions
filter isn't included in commons yet.


Yeah, that's what I meant; some stuff is in commons already, some stuff 
is in Tomahawk. Actually, I think most stuff except the filter itself, 
and maybe the default resource loader impl, are in commons. I added 
TOMAHAWK-155 to request the filter itself be moved over too.


L.



ADF Faces javascript rendering

2006-02-21 Thread Laurie Harper
The Tomahawk components 'inject' Javascript file references into the 
head section of the response by using a filter to buffer and 
post-process the response. I'm assuming ADF Faces has some mechanism for 
injecting Javascript too, but I can't seem to track it down...


I've found the code that handles serving static resources, just not the 
code responsible for injecting references to Javascript files. The 
reason I'm looking for it is so I can make a component library I'm 
working on use it.


Can anyone give me a pointer to the right area in the ADF Faces code, or 
even better a quick explanation of how to use it to do what I want?


Thanks,

L.