Hi,
We have been happy with the below suggestion for keeping our search
criteria in the URL:
onsubmit() {
setresponsepage(searchpage.class, crit.topageparameterrs());
};
Now we are beginning to experience the downsides: non-parameter backed
models on the page (how many rows to display per page for example) get
lost in this cycle.
Could you guys suggest some in-between approach, where part of the
state is stored in the URL, but the rest is kept in the components
(models)?
Thanks:
Gabor Szokoli
On Nov 28, 2007 9:46 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> why not just
>
>
> class searchpage extends webpage {
> private PageParameters params;
>
> private criteria crit=new criteria();
>
> public searchpage(pageparameters params) {
> this.params=params;
>
> add(new dataview("results", new dataprovider()) {... });
>
> form form=new form("form", new compoundproperty(new
> propertymodel(this, "crit"))) {
> onsubmit() {
> setresponsepage(searchpage.class, crit.topageparameterrs());
> };
> add(form);
> form.add(new textfield("name")); ....
>
>
> }
>
>
>
> private class dataprovider implements idataprovider {
> public iterator iterator(...) {
> return dao.search(params);
> } public int size() { return dao.size(params); }
> }
>
>
> done
>
> -igor
>
>
>
> On Nov 28, 2007 12:34 PM, Gabor Szokoli <[EMAIL PROTECTED]> wrote:
> > Hi there,
> >
> > I'd like to have a search form, which keeps the last submitted search
> > parameters in PageParameters in a bookmarkable fashion.
> > I am wondering about the "wicket way" of doing this, and I keep coming
> > back to an imaginary LoadableDetachableModel variant which would store
> > a unique key, and load/store its object value from/to the
> > PageParameters.
> > I'd appreciate some advice: What would be the nicest way to get hold
> > of the pageparameters in the current request from a model, and to set
> > one in the next response?
> > Or Is there some better way to achieve bookmarkable (partial) form state?
> >
> >
> > Thanks in advance:
> >
> > Gabor Szokoli
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]