Henrik Bentel wrote:
> Hi
> 
> This problem is related to a recent topic in another thread regarding
> calendar popup and porlets.
> 
> It seems the problem with the popup calendar is the same as I'm having
> with the tabbed pane component in a portal(Liferay).
> The tabbed pane components wants to add couple of javascript and a
> style sheet to the head section, which a portlet isn't allowed to do
> do inside a portal.
> Every portal seems of have it's own way of customizing what goes into
> the head section.
> 
> So, does anyone know if a way to get the tabbed pane component to
> render its javascript inline, and NOT depend on injecting stuff in the
> header?
> Not sure about how it does it but it seems this is done using the
> ExtensionFilter, or am I just wrong, wrong, wrong?
> 
> Basically, I'm looking for a a way to make the component not use the
> extension filter and render the javascript inline. It should also just
> ignore the task of including the css, leaving it up to the developer
> to make sure the style sheet is included in the page at run time.
> 
> That way I (hopefully) can just modify my liferay portal specific file
> to get the css included and have my awesom-o tabbed pane working.
> 
> thx,
> -Henrik
> 

Yes the extensionfilter does this stuff.  It serves component's external
resources (like .css and .js) files.  For servlets, it will also take
care of adding the stuff to <head> (I'm pretty sure... I've only done
portlets).

In HtmlTabbedPaneRenderer.java try changing "addJavaScriptToHeader" to
"addJavaScriptHere".  To do this you'll have to build tomahawk yourself.
  See http://myfaces.apache.org/buildhowto.html

The JavaScript code will not go inline, but the reference to the
external file will go inline.  So you'll still need the extensionsFilter
in place to serve that external file.  CSS resources will still have to
be added to <head> through directly modifying the portal's skin or
dynamically (a better solution) with
http://issues.apache.org/jira/browse/MYFACES-434

-- 
Dave Brondsema
Software Developer
Cornerstone University

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to