Ah, I looked for tableeditor in the scaladocs but was unable to find it. On Aug 22, 6:05 am, Naftoli Gugenheim <naftoli...@gmail.com> wrote: > I should have thought of that problem. > I could make TableEditor more flexible when I have time, but the truth is > that I don't know if it's worth it. The whole thing is less than 80 LOC with > scaladocs (not counting the utilities it uses which you can also use). The > real logic that provides its semantics is ItemsList, which includes > sortability, and is public. So it's probably not worth it to not write your > own snippet! The value of TableEditor is that it's automatic--3 lines in the > view and two in Boot, (actually that could surely be lessened when I have a > chance) and it works on any table. Once your customizing it it might not be > worth it. It basically does old fashioned binds, backed by an ItemsList > (better name anyone?). Also it uses eachField from mapper.view.Util, but in > your case you know which fields you have. > What do you think? > > ------------------------------------- > > glenn<gl...@exmbly.com> wrote: > > Naftoli, > > I must be doing something wrong. I tried the following, as you > suggested, > inserting the extra xml after the item:fields tag, but > ManagerUsers.list does its > own iteration through the table items and I get duplicate columns. > > ManageUsers.list just does a bind to the myuser:roles tag. > > <table:items> > <tr> > <item:fields fields="firstname lastname email" > > <td style="vertical-align: top"><field:form /></td> > </item:fields> > <lift:ManageUsers.list> > <td style="vertical-align: top"><myuser:roles /></td> > </lift:ManageUsers.list> > <td style="vertical-align: top"><item:removeBtn /></td> > </tr> > </table:items> > > Then, I have the added problem of saving changes to the item, since > roles is not > a field recognized by ItemsList.save. > > Any suggestions?? > > Kevin, > > I implemented asmselect in my app and it works great. > Thanks for the heads up. > > Glenn... > > On Aug 20, 3:44 pm, Naftoli Gugenheim <naftoli...@gmail.com> wrote: > > > It's not too hard to make your own without ajax. > > def addRemove(c: Child) = (_:Boolean) match { > > case true => if(!field.contains(c)) field+=c > > case false => field -= c} > > > Then iterate (flatMap) over Child.findAll creating a checkbox initialized > > to field.contains(x) with addRemove(x) as its setter. > > > ------------------------------------- > > > Kevin Wright<kev.lee.wri...@googlemail.com> wrote: > > > Absolutely spot-on article here about multiple selection on > > webpages:http://www.ryancramer.com/journal/entries/select_multiple/ > > I'm a big fan of asmselect, and the real beauty is that we already have > > jquery support in lift out-of-the-box :) > > <http://www.ryancramer.com/journal/entries/select_multiple/> > > > On Thu, Aug 20, 2009 at 11:27 PM, glenn <gl...@exmbly.com> wrote: > > > > Naftoli, > > > > I like the checkboxes style for a small selection (say 10 or less), > > > and perhaps a multi-selectbox if the choices are more numerous. > > > Another approach is to use two list boxes, one for the choices and > > > another for the selections, with maybe a drag-and-drop capability or > > > some add/remove buttons in between. I guess there is no good default > > > solution. > > > > One enhancement to your tableeditor would be a tableviewer option, > > > using a <field:toXml> instead of a <field:form> tag. > > > > Thanks for your help. > > > > Glenn... > > > > On Aug 20, 2:20 pm, Naftoli Gugenheim <naftoli...@gmail.com> wrote: > > > > The name is really a misnomer. It's not a MappedField. So it's missing > > > the opposite half: it _is_ the "validSelectValues" but it doesn't have the > > > toForm method of MappedField's to make use of its values. > > > > I'm not sure how a hypothetical "toForm" would work for a many-to-many > > > "field." Actually it depends on the circumstances. One option is how MS > > > Access works---every time you select a value you get a new blank row. This > > > is good where you can have many or duplicate children, but is more complex > > > to implement. Similarly you can have a list of current children and a > > > dropdown to add. Another option (where duplicates are not allowed) is a > > > set > > > of checkboxes. > > > > > ------------------------------------- > > > > > glenn<gl...@exmbly.com> wrote: > > > > > Naftoli, > > > > > Sorry for the addendum, but ideally, it would be nice to > > > > do something like: > > > > > override def validSelectValues: Box[List[(Long, String)]] ... > > > > > as you can with MappedLongForeignKey, and have a select box > > > > display in the table. > > > > > Glenn... > > > > > On Aug 20, 12:51 pm, glenn <gl...@exmbly.com> wrote: > > > > > > Naftoli, > > > > > > I tried using TableEditor with a MetaMapper instance of a ManyToMany > > > > > class, but <header:fields> and > > > > > <item:fields> tags in the template didn't pick up the MappedManyToMany > > > > > object in the class. > > > > > > Is there some method that I need to override,or is there some way to > > > > > write the template that will > > > > > resolve this? > > > > > > Glenn... > > > > > > On Aug 12, 2:48 pm, Naftoli Gugenheim <naftoli...@gmail.com> wrote: > > > > > > > I just wrote a brief wiki article on GitHub about using TableEditor, > > > but not > > > > > > being familiar with the formatting syntax, the code snippets are > > > truncated. > > > > > > Can anyone take a look at it and fix it? Thanks.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---