3 Replies Latest reply on Jun 11, 2012 12:43 PM by healeyb

    JSF custom components

    tomek.f

      Hello.

       

      I have a question about creating custom components in JSF. Does anyone do that? Is it maintainable in long term/ big projeccts? I  need to create customDataTable quite similar to Richfaces extendedDataTable. Your experience?

       

      Regards,

      Tomek.

        • 1. Re: JSF custom components
          blabno

          We're using custom components in every project. They are easy to maintain.

          • 2. Re: JSF custom components
            mcmurdosound

            I've extended / "improved" the richfaces ExtDT for our needs by extending the java classes for the UI-Components and the belonging Renderers. It's not a trivial task since the quite complex structure of some of the richfaces components. (AbstractRenderers, Eventhandling, RowRendering, TagHandlers etc.)

             

            Building simple Components from scratch is quite easy - on the other hand. Even adding child components, rerendering, a4j:supports and valueexpressions. But some there're still many things I don't understand and apparently nobody could help me with ;-)

            • 3. Re: JSF custom components
              healeyb

              I wrote a custom autocomplete component and found it pretty tricky. The thing that took a lot more work than expected was

              all the javascript required for the results popup and making it disappear. I reckon it took me two weeks to finish it, although I

              wasn't full time on it and an autocomplete is pretty simple in comparison to an extendedDataTable, but it was a first attempt

              by me at a custom component.

               

              It's a useful skill to have though, if the component library doesn't do what you want there's not much else you can do other

              than perhaps have a jQuery front end bolted onto a servlet.

               

              In fact the jQuery/servlet option maybe worth investigating further, there are some good jQuery datatable solutions out

              there such as http://datatables.net/.

               

              Regards,

              Brendan.