We are building a somewhat similar application. The only difference is
that we don't need to synch the search criteria with the search panel
(the Ajax dropdowns in your case), since the search panel in our
application will do a clean search when used from the results page.
The code looks something like this, which I don't think is too messy:
ResultPage extends WebPage {
private SearchCriteria criteria
// via bookmarked page
ResultPage(PageParameters params) {
searchCriteria = new SearchCriteria();
setPageParametersOnSearchCriteria(searchCriteria);
showResults(searchCriteria);
}
ResultPage(SearchCriteria criteria) {
showResults(searchCriteria);
}
}
Hopes this helps.
Lars
On Tue, Mar 4, 2008 at 2:42 PM, steviezz <[EMAIL PROTECTED]> wrote:
>
> I am using Ajax to populate 3 related DropDownChoice widgets in a search form
> (area, country, region) - see my
>
> http://www.nabble.com/Combining-Ajax-and-non-Ajax-pages-tt15587166.html#a15587166
> previous thread for more info.
>
> I am trying to maintain the search criteria in a model stored in the session
> so that the selected form state (used inside a panel on the site home page
> and reused in the search results page) reflects the displayed search results
> and survives navigation to and from the home page, page refreshes, back
> button clicks, etc. I more or less have this working.
>
> But I now want the results page to be bookmarkable (including query params).
>
> I'm currently trying to use my model object stored in the session just to
> maintain the state for the dropdowns, then submit the form to a mounted
> bookmarkable page to show the results.
>
> I can then take the page params and pass to my backend to do the actual
> search before displaying the results.
>
> Only problem I have now is that if someone comes in via a bookmarked page
> link, then the dropdown state will likely not be correctly initialised -
> either no model in session (default search form widgets - I can live with
> this) or a previous session model reflecting a different set of criteria
> than the query params and displayed results (I can't live with this).
>
> The rationale behind doing this whole thing is that I want my search results
> to be capable of being spidered from bookmarkable search results pages (so
> needs URL params rather than form post). But I do care about human users
> seeing incorrect state between the search form selections and the displayed
> results.
>
> So now I have to worry about resetting the session model when a bookmarked
> page is requested then updating the Ajax dropdowns. It's getting very messy
> and I feel I'm digging myself into a hole.
>
> So, is there an easy way to do this, or do I stop digging?
>
> --
> View this message in context:
> http://www.nabble.com/Use-Ajax-for-loading-form-dropdowns%2C-but-query-params-for-search--tp15827399p15827399.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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]