4 Replies Latest reply on May 12, 2010 5:28 AM by Igor Grinfeld

    How to add element to facet

    Igor Grinfeld Newbie

      Hi. I've created component that adds calendarType functionality to standart rich:calendar. calendarType may be ISO, Gregorian or Broadcast. It works well when type defined as tag attribute. Now, I want to add control button that allows to user change calendar type. I can simply add new input element to jspx template, but  I want to do it more flexible way, like todayControl of rich:calendar. There is no documentation, how I can create such element and to register it in facet and component. Can somebody explain it to me, please?

       

      Regards, Igor.

        • 1. Re: How to add element to facet
          Ilya Shaikovsky Master

          show please how you defining it using simple page definition and we'll review how to move into calendar.

          • 2. Re: How to add element to facet
            Igor Grinfeld Newbie

            Hello Ilya. What mean when you write 'defining it using simple page'?. If 'it' is changeType control and simple page is final html generated, the it'll be a td cell like 'Today' control that changes to next type when it clicked. Something like that:

             

            {code:xml}

            <div onclick='Richfaces.getComponent("sintecCalendar",this).switchToNextType();return true;'

                onmouseover='...' onmouseout='...' onmouseup='...' onmousedown='...'>

            </div>

            {code}

             

            I want that the 'div' about,  can be placed in every facet of calendar, as I see in rich:calendar example:

             

             

            {code:xml}

            <f:facet name="header">

                <h:panelGrid columns="2" width="100%" columnClasses="width100, fake">

                    <h:outputText value="{calendarTypeControl}" style="font-weight:bold; text-align:left"/>

                </h:panelGrid>
            </f:facet>

            {code}

            • 3. Re: How to add element to facet
              Ilya Shaikovsky Master

              I'm not sure that can see the actuall problem there. If the question is - how to make this solution reusable - define the calendar customized using that code in the facet in some facelet and use it instead of rich:calendar. 

              • 4. Re: How to add element to facet
                Igor Grinfeld Newbie

                My problem that calendarTypeControl variable is unknown to JSF, when I place it in JSP page.

                I want the person, that uses my component, can use calendarTypeControl, exactly like user that

                uses richCalendar, can use todayControl, applyControl and others. I don't see where this variable defined. Can you tell me?

                Igor