| Author |
Generating <script> tag from Custom JSF Tag
|
Kashif Nazar
Greenhorn
Joined: May 15, 2009
Posts: 12
|
|
Hi,
I am new to JSF Custom Tags. I developed a Custom tag. It's quite a fun to make your own custom tags . Now I have to use some javascript for my custom components. The inline javascript calls are no issue for me. But I want my javascript be embedded in a <script> tag automatically. So that I don't have to explicitly add my javascript into <script> tag, instead, it is automatically included in the page where my tags are being used. How can this be achieved?
Regards,
Kashif
|
Kashif
|
 |
Jason Lee
Greenhorn
Joined: Mar 03, 2008
Posts: 12
|
|
[quote=Kashif Nazar]Hi,
I am new to JSF Custom Tags. I developed a Custom tag. It's quite a fun to make your own custom tags :) . Now I have to use some javascript for my custom components. The inline javascript calls are no issue for me. But I want my javascript be embedded in a <script> tag automatically. So that I don't have to explicitly add my javascript into <script> tag, instead, it is automatically included in the page where my tags are being used. How can this be achieved?[/quote]
I'm not sure I understand your question. Are you wanting to add your custom JS to <head>? If so, you would user <h:outputScript>. If you're wanting something easier for inline JS from your composite component (which is what I'm assuming you mean by "custom tag?"), I'm not aware of anything to help there. A component for that seems like over kill. :)
|
Jason Lee, SCJP
Senior Member of Technical Staff with Oracle
http://blogs.steeplesoft.com
|
 |
satya anvesh
Greenhorn
Joined: Sep 23, 2008
Posts: 16
|
|
Hi
I want to include a .js script in a jsf page conditionally. That is, if a bean condition is true, one.js should be included otherwise two.js should be included. I am using JSF 1.1 so it does not support 'rendered' tag in <f:verbatim>. How can I achieve this? Thanks for your help.
Anvesh
|
 |
 |
|
|
subject: Generating <script> tag from Custom JSF Tag
|
|
|