Re: CheckGroup in a DataTable
are you sure they are being submitted properly, meaining does that list make it into checkgroup's model when switch pages? -igor On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > I am using a Check component inside of a DataTable. The DataTable is > surrounded by a CheckGroup. The model on each Check component is the Row > Model. This works great to get a list of checked rows. > > Is there a good way to retain the checks across pages? > > I created a new Navigator component that uses SubmitLinks instead of the > Link component, but he List of models doesn't retain the objects from the > previous page. > > Any suggestions? >
Re: CheckGroup in a DataTable
Yes, I added an onSubmit method on the form and it has all the checked models in the List. Then it changes pages and the next time I submit or change pages, they are gone. On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > are you sure they are being submitted properly, meaining does that list > make > it into checkgroup's model when switch pages? > > -igor > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > I am using a Check component inside of a DataTable. The DataTable is > > surrounded by a CheckGroup. The model on each Check component is the > Row > > Model. This works great to get a list of checked rows. > > > > Is there a good way to retain the checks across pages? > > > > I created a new Navigator component that uses SubmitLinks instead of the > > Link component, but he List of models doesn't retain the objects from > the > > previous page. > > > > Any suggestions? > > >
Re: CheckGroup in a DataTable
and whatever that model is it has a proper hashcode/equals implemented? -igor On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > Yes, I added an onSubmit method on the form and it has all the checked > models in the List. Then it changes pages and the next time I submit or > change pages, they are gone. > > On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > are you sure they are being submitted properly, meaining does that list > > make > > it into checkgroup's model when switch pages? > > > > -igor > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > > > I am using a Check component inside of a DataTable. The DataTable is > > > surrounded by a CheckGroup. The model on each Check component is the > > Row > > > Model. This works great to get a list of checked rows. > > > > > > Is there a good way to retain the checks across pages? > > > > > > I created a new Navigator component that uses SubmitLinks instead of > the > > > Link component, but he List of models doesn't retain the objects from > > the > > > previous page. > > > > > > Any suggestions? > > > > > >
Re: CheckGroup in a DataTable
No, in my test I didn't include the hascode/equals methods. I will give that a try. On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > and whatever that model is it has a proper hashcode/equals implemented? > > -igor > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > Yes, I added an onSubmit method on the form and it has all the checked > > models in the List. Then it changes pages and the next time I submit or > > change pages, they are gone. > > > > On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > > > are you sure they are being submitted properly, meaining does that > list > > > make > > > it into checkgroup's model when switch pages? > > > > > > -igor > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > > > > > I am using a Check component inside of a DataTable. The DataTable > is > > > > surrounded by a CheckGroup. The model on each Check component is > the > > > Row > > > > Model. This works great to get a list of checked rows. > > > > > > > > Is there a good way to retain the checks across pages? > > > > > > > > I created a new Navigator component that uses SubmitLinks instead of > > the > > > > Link component, but he List of models doesn't retain the objects > from > > > the > > > > previous page. > > > > > > > > Any suggestions? > > > > > > > > > >
Re: CheckGroup in a DataTable
I implemented hascode and equals on the row model object. I still get the same results. I also added the onBeforeRender and onAfterRender to the page to check the contents of the List. >From page 1 I checked two boxes. I then hit the next page. before render and after render both and the two Objects in the list. I then hit the previous page link and before render and after render both had an empty list. On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > No, in my test I didn't include the hascode/equals methods. I will give > that a try. > > On 8/30/07, Igor Vaynberg < [EMAIL PROTECTED]> wrote: > > > > and whatever that model is it has a proper hashcode/equals implemented? > > > > -igor > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > > > Yes, I added an onSubmit method on the form and it has all the checked > > > models in the List. Then it changes pages and the next time I submit > > or > > > change pages, they are gone. > > > > > > On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > > > > > are you sure they are being submitted properly, meaining does that > > list > > > > make > > > > it into checkgroup's model when switch pages? > > > > > > > > -igor > > > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED] > wrote: > > > > > > > > > > I am using a Check component inside of a DataTable. The DataTable > > is > > > > > surrounded by a CheckGroup. The model on each Check component is > > the > > > > Row > > > > > Model. This works great to get a list of checked rows. > > > > > > > > > > Is there a good way to retain the checks across pages? > > > > > > > > > > I created a new Navigator component that uses SubmitLinks instead > > of > > > the > > > > > Link component, but he List of models doesn't retain the objects > > from > > > > the > > > > > previous page. > > > > > > > > > > Any suggestions? > > > > > > > > > > > > > > > >
Re: CheckGroup in a DataTable
and you are sure all links in the navigator are submit links? if so then post a quickstart and we will take a look -igor On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > I implemented hascode and equals on the row model object. I still get the > same results. I also added the onBeforeRender and onAfterRender to the > page > to check the contents of the List. > From page 1 I checked two boxes. I then hit the next page. before render > and after render both and the two Objects in the list. I then hit the > previous page link and before render and after render both had an empty > list. > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > No, in my test I didn't include the hascode/equals methods. I will give > > that a try. > > > > On 8/30/07, Igor Vaynberg < [EMAIL PROTECTED]> wrote: > > > > > > and whatever that model is it has a proper hashcode/equals > implemented? > > > > > > -igor > > > > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > > > > > Yes, I added an onSubmit method on the form and it has all the > checked > > > > models in the List. Then it changes pages and the next time I > submit > > > or > > > > change pages, they are gone. > > > > > > > > On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > > > > > > > are you sure they are being submitted properly, meaining does that > > > list > > > > > make > > > > > it into checkgroup's model when switch pages? > > > > > > > > > > -igor > > > > > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED] > wrote: > > > > > > > > > > > > I am using a Check component inside of a DataTable. The > DataTable > > > is > > > > > > surrounded by a CheckGroup. The model on each Check component > is > > > the > > > > > Row > > > > > > Model. This works great to get a list of checked rows. > > > > > > > > > > > > Is there a good way to retain the checks across pages? > > > > > > > > > > > > I created a new Navigator component that uses SubmitLinks > instead > > > of > > > > the > > > > > > Link component, but he List of models doesn't retain the objects > > > from > > > > > the > > > > > > previous page. > > > > > > > > > > > > Any suggestions? > > > > > > > > > > > > > > > > > > > > > > >
Re: CheckGroup in a DataTable
Ok. I noticed in the updateModel method of the CheckGroup it is clearing the collection each time before adding the new ones to avoid duplicates in the collection. So I created a new component that extends the CheckGroup and changed the updateModel method. I removed the collection.clear() and instead of adding all the items, I check to make sure they don't already exist. Now it holds those checks across pages. public void updateModel() { Collection collection = (Collection)getModelObject(); if (collection == null) { collection = (Collection)getConvertedInput(); setModelObject(collection); } else { modelChanging(); Collection input = (Collection)getConvertedInput(); if(input != null && input.size() > 0) { for (Iterator iterator = input.iterator(); iterator.hasNext();) { Object object = (Object)iterator.next(); if(!collection.contains(object)) { collection.add(object); } } } modelChanged(); } } On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > and you are sure all links in the navigator are submit links? if so then > post a quickstart and we will take a look > > -igor > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > I implemented hascode and equals on the row model object. I still get > the > > same results. I also added the onBeforeRender and onAfterRender to the > > page > > to check the contents of the List. > > From page 1 I checked two boxes. I then hit the next page. before > render > > and after render both and the two Objects in the list. I then hit the > > previous page link and before render and after render both had an empty > > list. > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > > > No, in my test I didn't include the hascode/equals methods. I will > give > > > that a try. > > > > > > On 8/30/07, Igor Vaynberg < [EMAIL PROTECTED]> wrote: > > > > > > > > and whatever that model is it has a proper hashcode/equals > > implemented? > > > > > > > > -igor > > > > > > > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > > > > > > > Yes, I added an onSubmit method on the form and it has all the > > checked > > > > > models in the List. Then it changes pages and the next time I > > submit > > > > or > > > > > change pages, they are gone. > > > > > > > > > > On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > are you sure they are being submitted properly, meaining does > that > > > > list > > > > > > make > > > > > > it into checkgroup's model when switch pages? > > > > > > > > > > > > -igor > > > > > > > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED] > wrote: > > > > > > > > > > > > > > I am using a Check component inside of a DataTable. The > > DataTable > > > > is > > > > > > > surrounded by a CheckGroup. The model on each Check component > > is > > > > the > > > > > > Row > > > > > > > Model. This works great to get a list of checked rows. > > > > > > > > > > > > > > Is there a good way to retain the checks across pages? > > > > > > > > > > > > > > I created a new Navigator component that uses SubmitLinks > > instead > > > > of > > > > > the > > > > > > > Link component, but he List of models doesn't retain the > objects > > > > from > > > > > > the > > > > > > > previous page. > > > > > > > > > > > > > > Any suggestions? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Re: CheckGroup in a DataTable
then the problem is that previously checked but now unchecked things wont be cleared from your collection -igor On 8/31/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > Ok. I noticed in the updateModel method of the CheckGroup it is clearing > the collection each time before adding the new ones to avoid duplicates in > the collection. > So I created a new component that extends the CheckGroup and changed the > updateModel method. I removed the collection.clear() and instead of > adding > all the items, I check to make sure they don't already exist. Now it > holds > those checks across pages. > > public void updateModel() > { > Collection collection = (Collection)getModelObject(); > if (collection == null) > { > collection = (Collection)getConvertedInput(); > setModelObject(collection); > } > else > { > modelChanging(); > > Collection input = (Collection)getConvertedInput(); > if(input != null && input.size() > 0) { > for (Iterator iterator = input.iterator(); > iterator.hasNext();) > { > Object object = (Object)iterator.next(); > if(!collection.contains(object)) { > collection.add(object); > } > } > } > > modelChanged(); > } > } > > > On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > and you are sure all links in the navigator are submit links? if so then > > post a quickstart and we will take a look > > > > -igor > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > > > I implemented hascode and equals on the row model object. I still get > > the > > > same results. I also added the onBeforeRender and onAfterRender to > the > > > page > > > to check the contents of the List. > > > From page 1 I checked two boxes. I then hit the next page. before > > render > > > and after render both and the two Objects in the list. I then hit the > > > previous page link and before render and after render both had an > empty > > > list. > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > > > > > No, in my test I didn't include the hascode/equals methods. I will > > give > > > > that a try. > > > > > > > > On 8/30/07, Igor Vaynberg < [EMAIL PROTECTED]> wrote: > > > > > > > > > > and whatever that model is it has a proper hashcode/equals > > > implemented? > > > > > > > > > > -igor > > > > > > > > > > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > Yes, I added an onSubmit method on the form and it has all the > > > checked > > > > > > models in the List. Then it changes pages and the next time I > > > submit > > > > > or > > > > > > change pages, they are gone. > > > > > > > > > > > > On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > are you sure they are being submitted properly, meaining does > > that > > > > > list > > > > > > > make > > > > > > > it into checkgroup's model when switch pages? > > > > > > > > > > > > > > -igor > > > > > > > > > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED] > wrote: > > > > > > > > > > > > > > > > I am using a Check component inside of a DataTable. The > > > DataTable > > > > > is > > > > > > > > surrounded by a CheckGroup. The model on each Check > component > > > is > > > > > the > > > > > > > Row > > > > > > > > Model. This works great to get a list of checked rows. > > > > > > > > > > > > > > > > Is there a good way to retain the checks across pages? > > > > > > > > > > > > > > > > I created a new Navigator component that uses SubmitLinks > > > instead > > > > > of > > > > > > the > > > > > > > > Link component, but he List of models doesn't retain the > > objects > > > > > from > > > > > > > the > > > > > > > > previous page. > > > > > > > > > > > > > > > > Any suggestions? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Re: CheckGroup in a DataTable
Good point. I'll have to think about that one. On 8/31/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > then the problem is that previously checked but now unchecked things wont > be > cleared from your collection > > -igor > > On 8/31/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > Ok. I noticed in the updateModel method of the CheckGroup it is > clearing > > the collection each time before adding the new ones to avoid duplicates > in > > the collection. > > So I created a new component that extends the CheckGroup and changed the > > updateModel method. I removed the collection.clear() and instead of > > adding > > all the items, I check to make sure they don't already exist. Now it > > holds > > those checks across pages. > > > > public void updateModel() > > { > > Collection collection = (Collection)getModelObject(); > > if (collection == null) > > { > > collection = (Collection)getConvertedInput(); > > setModelObject(collection); > > } > > else > > { > > modelChanging(); > > > > Collection input = (Collection)getConvertedInput(); > > if(input != null && input.size() > 0) { > > for (Iterator iterator = input.iterator(); > > iterator.hasNext();) > > { > > Object object = (Object)iterator.next(); > > if(!collection.contains(object)) { > > collection.add(object); > > } > > } > > } > > > > modelChanged(); > > } > > } > > > > > > On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > > > and you are sure all links in the navigator are submit links? if so > then > > > post a quickstart and we will take a look > > > > > > -igor > > > > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > > > > > I implemented hascode and equals on the row model object. I still > get > > > the > > > > same results. I also added the onBeforeRender and onAfterRender to > > the > > > > page > > > > to check the contents of the List. > > > > From page 1 I checked two boxes. I then hit the next page. before > > > render > > > > and after render both and the two Objects in the list. I then hit > the > > > > previous page link and before render and after render both had an > > empty > > > > list. > > > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > > > > > > > No, in my test I didn't include the hascode/equals methods. I > will > > > give > > > > > that a try. > > > > > > > > > > On 8/30/07, Igor Vaynberg < [EMAIL PROTECTED]> wrote: > > > > > > > > > > > > and whatever that model is it has a proper hashcode/equals > > > > implemented? > > > > > > > > > > > > -igor > > > > > > > > > > > > > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > Yes, I added an onSubmit method on the form and it has all the > > > > checked > > > > > > > models in the List. Then it changes pages and the next time I > > > > submit > > > > > > or > > > > > > > change pages, they are gone. > > > > > > > > > > > > > > On 8/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > > are you sure they are being submitted properly, meaining > does > > > that > > > > > > list > > > > > > > > make > > > > > > > > it into checkgroup's model when switch pages? > > > > > > > > > > > > > > > > -igor > > > > > > > > > > > > > > > > On 8/30/07, Tim Lantry <[EMAIL PROTECTED] > wrote: > > > > > > > > > > > > > > > > > > I am using a Check component inside of a DataTable. The > > > > DataTable > > > > > > is > > > > > > > > > surrounded by a CheckGroup. The model on each Check > > component > > > > is > > > > > > the > > > > > > > > Row > > > > > > > > > Model. This works great to get a list of checked rows. > > > > > > > > > > > > > > > > > > Is there a good way to retain the checks across pages? > > > > > > > > > > > > > > > > > > I created a new Navigator component that uses SubmitLinks > > > > instead > > > > > > of > > > > > > > the > > > > > > > > > Link component, but he List of models doesn't retain the > > > objects > > > > > > from > > > > > > > > the > > > > > > > > > previous page. > > > > > > > > > > > > > > > > > > Any suggestions? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Re: CheckGroup in a DataTable
Hi, > in order for CheckGroup to work, I think I have to wrap it in a "span" correct, the CheckGroup needs its own HTML tag. >Adding AjaxFormChoiceComponentUpdatingBehavior is not receiving any events. I've checked your code posted on Nabble, but it didn't seem to include the relevant bits. Could you rephrase your actual problem? Regards Sven On 25.01.2015 20:56, Arjun Dhar wrote: I have a DataTable where the first column is a set of Checkboxes for every row. I felt a CheckGroup would be a nice thing to use here for Deleting multiple rows. However I want also Ajax events on the Check of a box to only show the DELETE Button should any box be selected. The problem is that in order for CheckGroup to work, I think I have to wrap it in a "span" and make my HTML nasty like: Adding AjaxFormChoiceComponentUpdatingBehavior is not receiving any events. I assume thats because im being stubborn .. but hoping for a more elegant solution. .. I have to use DataTable and I need to Ajaxify the checkboxes here. Java code is something like Any thoughts appreciated. thanks - Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/CheckGroup-in-a-DataTable-tp4669111.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: CheckGroup in a DataTable
Thanks ... I edited my post. I'll simplify my questions further: 1. I find it tacky to have to wrap the entire DataTable in a span or a Div for check group. Is there any way I can apply it on the column level. Its hard to imagine. 2. "AjaxFormChoiceComponentUpdatingBehavior" get called for each CheckBox it checks automatically, if you check the "CheckGroupSelector". ... I'd like only 1 Event fired if any One CheckBox is selected in the entire group. ... anyway to filter the event lsitener? thanks - Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/CheckGroup-in-a-DataTable-tp4669111p4669113.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: CheckGroup in a DataTable
Hi, > I find it tacky to have to wrap the entire DataTable in a span or a Div for check group usually your web designer will use enough DIVs in the markup anyway, so you rarely have to add an additional one just for your Wicket component. "AjaxFormChoiceComponentUpdatingBehavior" get called for each CheckBox ... if you check the "CheckGroupSelector" Each selected checkbox will trigger an event, which is then received by the AjaxFormChoiceComponentUpdatingBehavior. You might be able to work around this by configuring AjaxRequestAttributes#throttleSettings. Regards Sven On 25.01.2015 21:54, Arjun Dhar wrote: Thanks ... I edited my post. I'll simplify my questions further: 1. I find it tacky to have to wrap the entire DataTable in a span or a Div for check group. Is there any way I can apply it on the column level. Its hard to imagine. 2. "AjaxFormChoiceComponentUpdatingBehavior" get called for each CheckBox it checks automatically, if you check the "CheckGroupSelector". ... I'd like only 1 Event fired if any One CheckBox is selected in the entire group. ... anyway to filter the event lsitener? thanks - Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/CheckGroup-in-a-DataTable-tp4669111p4669113.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org