Hello, thx a lot for your input! In fact the value are sticking well after the submit. But I was explicitly reloading a new page with the values of the checkboxes. So that was bad but my Form model should be oK.
What I don't understant is that I created a Form that I added to my Page. I didn't relate the form to the DefaultDataTable This table has a DataProvider. Do I have to use an instance variable in that provides that would keep the state of my checkboxes? How is this state modified when I modify my InputForm? What is or should be the connection betwee the Form et the DataProvider. How are used the getFilterState and setFilterState of my DataProvider. I know I've got a lack of understanding those concept. What should I read to fill this gap? Thanks a lot! Ox igor.vaynberg wrote: > > you dont need to do anything in onsubmit, it will automatically reload the > current page unless you call setresponsepage to another one. > > if the values are not sticking after submit that means they are not saved > properly, you might want to look at your models. > > -igor > > On 7/3/07, Ox <[EMAIL PROTECTED]> wrote: >> >> >> Hello, >> >> I'm trying do display a simple Data Table with a filter on it. >> I had a look at the wicket-phonebook example because what I have to do is >> really similar to that example. >> So I will refer to the code of this example to describe my problem. >> >> The thing is I want to have some filter on the table that would add a >> criteria on a status column (not present in the wicket-phonebook >> example). >> This status would be an Integer and I would like to dispay a checkGroup >> as >> filter on this status! >> >> I don't really understand how the page should reload keeping the filter >> status (meaning the checked checkboxes) and refreshing the table with the >> status criteria. >> (NB I don't want to use Ajax here) >> Do I have to Implement a load method in my DetachebleContactModel? >> >> I succeeded linking the criteria to my query but don't succeed to refresh >> the page correctly. >> >> Can somebody help me with some clues or code example? >> >> I putted some of my code here... >> The rest is really base on the wicket-phonebook example >> >> I have seen a similar question in the "Filterable ListViews" thread but >> don't really understand how to adapt it in the phonebook example. >> >> Thanks a lot, >> Ox >> >> >> >> public class ListContactPage extends BasePage { >> >> ... >> >> public ListContactPage(List statuses) { >> >> add(new InputForm("inputForm")); >> ... >> >> >> RequestDataProvider dataProvider = new >> ConatctDataProvider( >> getContactDao(), statuses); >> >> DefaultDataTable table = new >> DefaultDataTable("requestTable", Arrays >> .asList(columns), dataProvider, 15); >> >> // I don't use it >> // ... addTopToolbar(new FilterToolbar(... >> add(table); >> ... >> >> } >> >> >> private class InputForm extends Form { >> >> >> public InputForm(String name) >> { >> super(name, new CompoundPropertyModel(new >> FormInputModel())); >> >> CheckGroup statusChecks = new >> CheckGroup("statusCheckGroup"); >> add(statusChecks); >> ListView statusChecksList = new ListView("statuses", >> ContactUtil.getStatusCodes()) >> { >> protected void populateItem(ListItem item) >> { >> item.add(new Check("scheck", item.getModel >> ())); >> item.add(new Label("status", >> item.getModelObjectAsString())); >> }; >> }; >> statusChecks.add(statusChecksList); >> >> ... >> >> } >> >> public void onSubmit(){ >> info("Search model " + getModelObject()); >> >> //Do I have to set a ResponsePage here? Or will >> it >> automatically remains >> and reload the current page >> } >> >> } >> >> ... >> } >> >> >> public class ListContactPage extends BasePage { >> >> ... >> >> public ListContactPage(List statuses) { >> >> add(new InputForm("inputForm")); >> ... >> >> >> RequestDataProvider dataProvider = new >> ConatctDataProvider( >> getContactDao(), statuses); >> >> DefaultDataTable table = new >> DefaultDataTable("requestTable", Arrays >> .asList(columns), dataProvider, 15); >> >> // I don't use it >> // ... addTopToolbar(new FilterToolbar(... >> add(table); >> ... >> >> } >> >> >> private class InputForm extends Form { >> >> >> public InputForm(String name) >> { >> super(name, new CompoundPropertyModel(new >> FormInputModel())); >> >> CheckGroup statusChecks = new >> CheckGroup("statusCheckGroup"); >> add(statusChecks); >> ListView statusChecksList = new ListView("statuses", >> ContactUtil.getStatusCodes()) >> { >> protected void populateItem(ListItem item) >> { >> item.add(new Check("scheck", item.getModel >> ())); >> item.add(new Label("status", >> item.getModelObjectAsString())); >> }; >> }; >> statusChecks.add(statusChecksList); >> >> ... >> >> } >> >> public void onSubmit(){ >> info("Search model " + getModelObject()); >> >> //Do I have to set a ResponsePage here? Or will >> it >> automatically remains >> and reload the current page >> } >> >> } >> >> ... >> } >> -- >> View this message in context: >> http://www.nabble.com/Filterable-DefaultDatatable-tf4018736.html#a11413575 >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Wicket-user mailing list >> Wicket-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wicket-user >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > -- View this message in context: http://www.nabble.com/Filterable-DefaultDatatable-tf4018736.html#a11428499 Sent from the Wicket - User mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user