hi Ruslan, I see your point, but I can't find a better solution :)
Having one Form::Field subclass for all kinds of multiple-choice selection looks attractive, but difficult to implement and make everyone happy. In regards to div/span layout: the choices should be arranged one above the other, otherwise it doesn't scale. In the application which I develop now, I extract a number of data element names from an external database, and then let the user choose all or some of them for further processing. The number can be arbitrary, so they have to be arranged one on top of the other. Probably I have to end up with a subclass of Action and override attributes() so that it generates the needed number of checkboxes. However, then we don't have a way to group them (I actually extract 4 different groups of data elements, and was going to give the user four multiple-choice selections on one page). any suggestions? ________________________________ From: Ruslan Zakirov <ruslan.zaki...@gmail.com> To: Nifty apps in a Jiffy <jifty-devel@lists.jifty.org> Sent: Friday, September 4, 2009 9:10:19 PM Subject: Re: [jifty-devel] Multiple-choice with checkbox Hello Stanislav, May be I was not clear enough. I was not talking about multiple groups of checkboxes, but only about a selector widget that allows user select one or several values for an argument of the action. We can render such selector widget in different ways, for example it can "select" set of radio buttons, set of checkboxes to allow user select multiple values, it can be combobox to allow user type alternative value, it can checkboxes with text input for alternative. For you as developer there should be no difference between them, you picked multi-select, but then decided that checkboxes are better and you just switch renderer and code just works. About your code: * MultiChoice is bad name. You say that you prefer elementary functionality then it should be named Checkbox. Checkbox is the way to allow people choose multiple values, otherwise radio buttons should be used. * ::Radio, ::Select and other don't wrap widget into a div and you shouldn't too * probably you shouldn't wrap each element into a div, but span What I don't like is Zoo and hope you understand that it's more pleasant to work with consistent and predictable enviroment. On Fri, Sep 4, 2009 at 7:52 PM, Stanislav Sinyagin<ssinya...@yahoo.com> wrote: > hi Ruslan, > > I think your proposal is a bit orthogonal to what is implemented now. Each of > the Form::* classes implement some elementary form input, so I would prefer > having > it the same way. > > Also multiple checkboxes need a bit of different indentation, so that one > could recongize a group. > > Here's a first draft of the new module. I'm not sure yet the default_values > work correctly: > http://pastebin.com/m599d2e1d > > regards, > stanislav > > > > > ----- Original Message ---- >> From: Ruslan Zakirov <ruslan.zaki...@gmail.com> > >> ::Form::Choice with the following properties: look => {Dropdown, >> List}, multiple => {0, 1}, alternative => {0, 1}. >> >> This widget can delegate to particular implementation depending on >> properties: >> >> Dropdown => Select >> Dropdown, alternative => Combobox >> List => Radios >> List, multiple => Checkboxes >> ... >> >> As you can see it requires more work, but you can implement only what >> you need and live some combinations not implemented. For example >> radios with alternative may look like this: >> > > _______________________________________________ > jifty-devel mailing list > jifty-devel@lists.jifty.org > http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel > -- Best regards, Ruslan. _______________________________________________ jifty-devel mailing list jifty-devel@lists.jifty.org http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel _______________________________________________ jifty-devel mailing list jifty-devel@lists.jifty.org http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel