4 Replies Latest reply on Sep 30, 2008 4:58 AM by daniel.soneira

    htmLib in Facelets

    rosi75

      Hi

      Has anybody experiances with facelets and htmLib?

      By migrating my jsp's into xhtml files I have the problem, that htmLib tag are not converted into html on runtime. So I got htm:td and htm:table... tags in my html code.. that's strange because all other tags are working fine.

      I declared htmLib as usual in the top of my xhtml file:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <f:view xmlns="http://www.w3.org/1999/xhtml"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:t="http://myfaces.apache.org/tomahawk"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:htm="http://jsftutorials.net/htmLib">
      
      <htm:table>
       <htm:tr>
       ...
       </htm:tr>
      </htm:table>
      
      </f:view>
      


      the result of this file in my browser is:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
      <htm:table>
       <htm:tr>
       ...
       </htm:tr>
      </htm:table>
      


      thanks for any advise.
      regards
      rosi



        • 1. Re: htmLib in Facelets
          rosi75

          I tried to add the taglib of htmLib to my project. It does not work. I also inserted the following param to web-xml:

           <param-name>facelets.LIBRARIES</param-name>
           <param-value>
           /WEB-INF/tags/htmlib.taglib.xml;
           </param-value>
           </context-param> -->
          


          but it seems that facelet cannot render these htmLib Tags. But why?

          • 2. Re: htmLib in Facelets
            bigbaray

            Hmmm. Sounds like my problem. Does this stuff work?

            • 3. Re: htmLib in Facelets
              daniel.soneira

              Rosi,

              There is no point in using htmLib with Facelets in the first place.
              You can use simple and plain HTML tags instead (that's the cool thing about Facelets).

              Upon migrating to Facelets I first got rid of htmLib and simply replaced all "htm:" with "" ;)

              If you want to use the "rendered" attribute on HTML tags you can wrap them in <ui:fragment> like that:

              <table>
               <ui:fragment rendered="${backingBean.myBooleanValue}">
               <tr>
               ...
               </tr>
               </ui:fragment>
              </table>
              


              So my advice is: Get rid of htmLib.

              • 4. Re: htmLib in Facelets
                daniel.soneira

                Well, since this thread is kind of REALLY old (how did you dig that one up?).. my advice goes to bigbaray then I guess :D