Ouch, this sounds very dirty ..

Can you not just add a fragment, which is rendered in the head of the page you're using? This may be as dirty as the solution below, just let me know if that's the case :)

J.Enrique Ruiz-Valenciano wrote:
Yes, if it is possible, but note that the portlet generates a fragment of the HTML, then you must inject the reference to the CSS file in the HTML page. You can do it by including the following Javascript in the portlet JSP pages:

<script type="text/javascript">
   var stylesheetLink = document.createElement('link');
   stylesheetLink.type = 'text/css';
   stylesheetLink.rel = 'stylesheet';
   stylesheetLink.href = '${renderRequest.contextPath}/css/portlet.css';
   document.getElementsByTagName('head')[0].appendChild(stylesheetLink);
</script>


Hi all,

I was wondering if it's possible to define and use an specific CSS for JSPs in a portlet. I mean, define a new CSS (in addition to the portlet decorator) for several HTML elements that are going to be used when the portlet is rendered. I think it's not possible since the LINK tag necessary to load the CSS in the JSP or the HTML must be placed in the head section of the page, and that section is not available from inside the portlet.

Am I wrong and that can be done? Or the only way is to define inline styles?

Thanks in advance,
Enrique

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--

Hippo
Oosteinde 11
1017WT Amsterdam
The Netherlands
Tel  +31 (0)20 5224466
-------------------------------------------------------------
[EMAIL PROTECTED] / http://www.hippo.nl
--------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to