|
|
|
Weird, your taglib should be recognized as is given the client code has JSPX filetype
The taglib should be under WEB-INF, is it the case?
The problem is caused because I have a companion "my.tld" file as well. When this file was removed the facelets EL function became known to IDEA.
The "my.tld" file was added because it makes IDEA clever regarding tags defined in the "my.taglib.xml". The example I attached before was abbreviated. my.taglib.xml <!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_0.dtd"> <facelet-taglib xmlns="http://java.sun.com/JSF/Facelet"> <namespace>http://genomix.es.dupont.com/faces/trak</namespace> <tag> <tag-name>nameAjax</tag-name> <source>nameAjaxTag.xhtml</source> </tag> <function> <function-name>stackTrace</function-name> <function-class>genomix.tractor.backing.FaceletFunctions</function-class> <function-signature>java.lang.String stackTrace(java.lang.Exception)</function-signature> </function> </facelet-taglib> With only this file defined, a facelets reference like the following: snippet <trak:nameAjax id="suser" nameAjax="#{newLead.suserAjax}"/>
puts all the burden on the user to know what the attributes are, and which are required, etc. This is fixed by adding the "my.tld", as follows: my.tld <?xml version="1.0" encoding="ISO-8859-1" ?> <taglib xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd" version="2.1"> <description> Tags useful in the Lead Tracking application </description> <tlib-version>1.2</tlib-version> <short-name>trak</short-name> <uri>http://genomix.es.dupont.com/faces/trak</uri> <tag> <description> <![CDATA[Tags for picking a Sybase user by typing a few letters of the name. ]]> </description> <name>nameAjax</name> <tag-class>java.lang.Object</tag-class> <body-content>empty</body-content> <attribute> <description>An prefix to attach to ids to make them unique in a faces view.</description> <name>id</name> <required>true</required> <deferred-method> <method-signature>java.lang.String getId()</method-signature> </deferred-method> </attribute> <attribute> <description>What to rerender on change in picklist.</description> <name>reRender</name> <required>false</required> <deferred-method> <method-signature>java.lang.String getReRenderList()</method-signature> </deferred-method> </attribute> <attribute> <description>Required state on the select list. Default is true</description> <name>required</name> <required>false</required> <deferred-method> <method-signature>java.lang.Boolean isRequired()</method-signature> </deferred-method> </attribute> <attribute> <description>The NameAjax bean that drives the component</description> <name>nameAjax</name> <required>true</required> <deferred-method> <method-signature>genomix.tractor.backing.NameAjax method()</method-signature> </deferred-method> </attribute> </tag> </taglib> The tag has a bogus implementation of "java.lang.Object" because it is not supposed to be used with a JSP view handler. But what it does very nicely is make the tag come alive in IDEA with documentation and completion. Until facelets is updated to allow more information to be put in the definition file, this hack is extremely useful, so it would be very nice if IDEA would combine the information from both the xml and tld files. Related issues: http://www.jetbrains.net/jira/browse/IDEADEV-21388 I bet you can update "companion" tld file to contain 'function' too. We plan to have better Seam support in Diana
Thanks – you win the bet, the function can be defined in the tld. The issue raised in http://www.jetbrains.net/jira/browse/IDEA-16382
|
||||||||||||||||||||||||||||||||||||
<!DOCTYPE facelet-taglib PUBLIC
"-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
"http://java.sun.com/dtd/facelet-taglib_1_0.dtd">