7 Replies Latest reply on Jun 28, 2007 1:55 AM by Gavin King

    Facelets (Source) Tags problems with seam validation

    Carlos Zaniolo Newbie

      Hi,

      I'm having some problems with seam validation and facelets source tags. It is not working!
      To reproduce, in the booking example, just change in the register.xhtml:

      from:

      <h:inputText id="username" value="#{user.username}" required="true">
       <a:support event="onblur" reRender="usernameErrors"/>
      </h:inputText>
      <br/>
      <a:outputPanel id="usernameErrors"><s:message/></a:outputPanel>


      to:
      <my:input id="username" value="#{user.username}" />


      where <my:input> is:
      (input.xhtml in /view/custom)
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:a="https://ajax4jsf.dev.java.net/ajax"
       xmlns:h="http://java.sun.com/jsf/html">
       <ui:composition>
       <h:inputText id="#{id}" value="#{value}" required="true">
       <a:support event="onblur" reRender="#{id}Errors"/>
       </h:inputText>
       <br/>
       <a:outputPanel id="#{id}Errors"><s:message/></a:outputPanel>
       </ui:composition>
      </html>


      And, of course, it is needed to have a taglibrary declaration in web.xml and the namespace declaration in register.xhtml.

      Whit this, only the required validation (from jsf) will work, but the length validation (from seam) will not.

      my.taglib.xml:
      <?xml version="1.0"?>
      <!DOCTYPE facelet-taglib PUBLIC
       "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
       "http://java.sun.com/dtd/faces-taglib_1_0.dtd">
      
      <facelet-taglib>
       <namespace>http://my/jsf/taglib</namespace>
       <tag>
       <tag-name>input</tag-name>
       <source>../custom/input.xhtml</source>
       </tag>
      </facelet-taglib>


      in web.xml:
      ...
      <context-param>
       <param-name>facelets.LIBRARIES</param-name>
       <param-value>/WEB-INF/my.taglib.xml</param-value>
      </context-param>
      ...


      Thanks,
      Carlos Zaniolo