1 Reply Latest reply on Nov 28, 2013 11:19 AM by

    ButtonGroup RichWidget

    Michal Petrov Master

      Hi all,

       

      I've created a button group widget (the branch is here). Based on what's showcased on the Bootstrap site I've implemented sizing, justification, vertical grouping and button styling. The widget also turns nested lists into dropdowns (which I guess can be expanded to process any nested elements).

       

      I'd ask for a code review (since this is my first work on RichWidgets) and I also have a few questions:

      • How much styling are we expecting on user side? Right now I'm only applying style to buttons if they weren't styled already (and if they aren't styled the group doesn't work).
      • Should I write any tests?
      • Any other functionality to add?

       

      Michal

        • 1. Re: ButtonGroup RichWidget

          Hey Michal,

           

          I have reviewed your impl quickly

           

          and there is one conceptual problem I have found:

           

          in order to achieve as slick performance as possible on client-side,

          we should prefer CSS-only components over JS+CSS ones.

           

          I believe ButtonGroup is a sample of component that doesn't have to use JS

          (Widget Factory)

          at all.

           

          (Note that JSF Bridge code may be required though).

           

          Even in case where JS is required, it is good practice to build whole

          component on simple and CSS-styled markup

          and the continue to tie in JS things like event handling.

           

          ~ Lukas

           

           

          On Wed, Nov 27, 2013 at 5:21 PM, Michal Petrov <

          richfaces-dev@lists.jboss.org> wrote:

           

          Hi all,

           

          I've created a button group widget (the branch is here (

          https://github.com/richwidgets/richwidgets/tree/buttongroup)). Based on

          what's showcased on the Bootstrap site (

          http://getbootstrap.com/components/#btn-groups) I've implemented sizing,

          justification, vertical grouping and button styling. The widget also turns

          nested lists into dropdowns (which I guess can be expanded to process any

          nested elements).

           

          I'd ask for a code review (since this is my first work on RichWidgets) and

          I also have a few questions:

          • How much styling are we expecting on user side? Right now I'm only

          applying style to buttons if they weren't styled already (and if they

          aren't styled the group doesn't work).

          • Should I write any tests?

          • Any other functionality to add?

           

          Michal

           

          Posted by forums

          Original post: https://community.jboss.org/message/847489#847489

          _______________________________________________

          richfaces-dev mailing list

          richfaces-dev@lists.jboss.org

          https://lists.jboss.org/mailman/listinfo/richfaces-dev