how can i add a js file to my own composite component taglib?
I have following strucuture:
src/main/resources/META-INF/
- mytaglib.xml
- faces-config.xml
src/main/resources/META-INF/resources
- myComponent.xhtml
In myComponent.xhtml i want to add a js file. How can i do this and where i have to put this js file?
Solved - see my comment
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core">
<head>
<title>An button with JS</title>
</head>
<body>
<cc:interface>
<h:outputScript library="js" name="test.js" />
</cc:interface>
<cc:implementation>
<p:commandLink value="test" onclick="myFunc();" />
</cc:implementation>
</body>
</html>