4 Replies Latest reply on Jun 11, 2013 2:25 PM by desertratx

    Extend richfaces component via composite component

    desertratx

      I would like to extend a rich:tooltip component via jsf composite component

       

      unfortunatly i don't even get a normal rich:tooltip to work:

       

       

      {code}html xmlns="http://www.w3.org/1999/xhtml"

       

            xmlns:composite="http://java.sun.com/jsf/composite"

            xmlns:rich="http://richfaces.org/rich"

            xmlns:a4j="http://richfaces.org/a4j"]

       

          [composite:interface]

          [/composite:interface]

       

          [composite:implementation]

              [a4j:outputPanel]

                  [rich:tooltip]

                      test

                      [composite:insertChildren /]

                  [/rich:tooltip]

              [/a4j:outputPanel]

          [/composite:implementation]

       

      [/html]                                      

      {code}

       

      Now the question:

       

      Is it even possible to use rich as well as a4j tags in a composite component or do i need to use Richfaces CDK. If i need Richfaces CDK, can someone point out a link to a good tutorial..

        • 1. Re: Extend richfaces component via composite component
          bleathem

          The above should work.  What does your failure look like?  Do you get any errors on the server or in the browser console?  If you take the same code snippet and drop it in  a page, does it work as expected?

          • 2. Re: Extend richfaces component via composite component
            desertratx

            Okay, while creating a minimum working environment i found my problem:

            In my xhtml file is use tooltips as follows:

            [a4j:outputPanel]

                 [h:graphicImage/] or [h:ouputText/]

                 [rich:tooltip/]

            [/a4j:outputPanel]

             

            which works perfectly. Now i want to replace the rich:tooltip with my own tooltip.

             

            Unfortunatly if i now replace the rich:tooltip with a composite component which looks like this...

            [composite:implementation]

                        [rich:tooltip]

                            test

                            [composite:insertChildren /]

                        [/rich:tooltip]

            [/composite:implementation]

             

            my custom tooltip does not work as the a4j:outputPanel seems to get different ids and cannot be referenced by my custom tooltip.

             

            So for displaying a component with a tooltip i need the a4j:panel around both components, either on my page or in the composite component. Therefore i might have to get my image or text into the composite component.

             

            That found out, I still need a way to extend the rich:tooltip with my own tooltip. It would be quite practically, if I don't have to create each attribute of rich:tooltip for my own tooltip and set it in the composite component.

            I'm would welcome any ideas

            • 3. Re: Extend richfaces component via composite component
              bleathem

              You can try to use the #{cc.parent.clientId} (or something similar) to access the id of the composite component's parent.

              • 4. Re: Extend richfaces component via composite component
                desertratx

                sry  if not clear enough...

                my question would be: how to define the rich:tooltip as parent in the composite:interface BUT i think if i read a little into the documentation I will find out

                 

                So you might close this thread

                Thx a lot