5 Replies Latest reply on Nov 9, 2007 2:23 PM by sergeysmirnov

    CDK - problem

    diegocoronel

      hey, i was trying to make some components with CDK, and my first try was to custom Calendar, just to learn. i did

      <?xml version="1.0" encoding="UTF-8"?>
      <f:root
       xmlns:f="http://ajax4jsf.org/cdk/template"
       xmlns:cJstl="http://java.sun.com/jstl/core"
       xmlns:c=" http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:ui=" http://ajax4jsf.org/cdk/ui"
       xmlns:u=" http://ajax4jsf.org/cdk/u"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:uiFacelets="http://java.sun.com/jsf/facelets"
       xmlns:x=" http://ajax4jsf.org/cdk/x"
       class="org.richfaces.renderkit.html.Fpf_calendarRenderer"
       baseclass="org.richfaces.renderkit.Fpf_calendarRendererBase"
       component="org.richfaces.component.UIFpf_calendar">
      
       minha variavel: #{component.attributes['pattern']} <br />
       meu valor: #{this:getInputValue(context,component)} <br />
       value: #{value} <br />
       value: #{id} <br />
       value: #{type} <br />
       value: #{name} <br />
      
       <f:clientid var="clientId"/>
      
       <div id="#{clientId}" x:passThruWithExclusions="value,name,type,id" >
       <c:if test="${empty component.attributes['pattern']}">
       <c:set var="meuPattern" value="dd/MM/yyyy" />
       </c:if>
       <c:if test="${!empty component.attributes['pattern']}">
       <c:set var="meuPattern" value="${component.attributes['pattern']}" />
       </c:if>
       <rich:calendar datePattern="${meuPattern}" value="#{this:getInputValue(context,component)}" >
       </rich:calendar>
       </div>
      </f:root>
      


      but my calendar isnt working, how can i make rich:calendar be rendered ??

        • 1. Re: CDK - problem
          ilya_shaikovsky

          currently components arent available in templates. I think it will be easily for you - to create facelets template

          • 2. Re: CDK - problem
            diegocoronel

            but my problem is that i need to make a reusable component, like create a jar and put in other projects. is that possible with facelets template ? can you post some code how to do it ?? ty

            • 3. Re: CDK - problem

              You want to have a composition of existing components, but not making a reusable component. The component is reusable by definition even it does not consist of other components.

              CDK is not for compositions. Using facelets is a preferable solution.

              • 4. Re: CDK - problem
                diegocoronel

                ty for your answer, but is possible to add some java code using facelets? like, make my own component business rules ? like my facelet component that add, find, remove items from a list ? Or its possible to create a jar from my facelet component and add in other projects ?...

                • 5. Re: CDK - problem

                  It would be much helpful to get the answers about facelets in the facelets mailing list