store the backing model in the session and get it from the session, this
will help you retain the state in all the cases

Cheers
Dipu

On Feb 20, 2008 11:38 AM, steviezz <[EMAIL PROTECTED]> wrote:

>
> I have a panel on my application home page containing 3 related dropdowns
> -
> area/country/region.
>
> I use AjaxFormComponentUpdatingBehavior to populate the lower dropdowns
> when
> a higher one changes - eg:
>
>  area changes - country and region dropdowns get reset
>  country changes - region dropdown gets reset
>
> Code looks like:
>
>     private DropDownChoice getCountriesDDC(IModel countryChoices,
>                        final DropDownChoice regions) {
>
>                logger.debug("Enter getCountriesDDC");
>
>                final DropDownChoice countries = new
> DropDownChoice("countries",
>                                new PropertyModel(this, "selectedCountry"),
> countryChoices,
>                                new ChoiceRenderer("name", "id"));
>
>                countries.add(new
> AjaxFormComponentUpdatingBehavior("onchange") {
>                        protected void onUpdate(AjaxRequestTarget target) {
>                                regions.clearInput();
>                                regions.setModelObject(null);
>                                target.addComponent(regions);
>                        }
>                });
>
>                countries.setOutputMarkupId(true);
>
>                logger.debug("Exit getCountriesDDC " + countries);
>
>                return countries;
>        }
>
>
> My application is not a full-blown Ajax app - it still needs to be search
> engine and user friendly.  So, when I submit my form having selected the
> various dropdowns, I want to forward to a traditional results pages rather
> than pull the results into the original page with Ajax.
>
> But I also want to include the search panel at the top of the results page
> and maintain its dropdown state from the original search page (so the
> selection matches the displayed results).  For example, user selects
> "North
> America / United States / California" on the search page, then the results
> page should have all 3 dropdowns popluated with all the North American
> choices in dropdown 2, and the USA states in dropdown 3 - with USA and
> California selected.
>
> I also need to maintain the same search panel dropdown state if the user
> uses the main site navigation links to go back to the home page - this
> will
> be from a simple url like /app/home.
>
> Search dropdown state must also survive a page refresh.  I hate it when
> applications (typical flight booking systems, etc) make you re-enter all
> the
> search criteria if you go back to the home page, deviate out of their
> restricted page-flow, or refresh the page.  At present, on page refresh,
> my
> the top level area dropdown retains its choices but the country and region
> dropdowns have their choices removed (no way to get them back unless you
> select a different top level area to re-fire the Ajax Javascript).
>
> In summary, I need to know:
>
> 1.  how to make the dropdown state survive when I include the search panel
> on another page
>
> 2.  how to make the dropdown state survive when I navigate back to the
> original page using a simple home page navigation link (effectively
> reloading the home page)
>
> 3.  how to make the dropdown state survive a page refresh (much the same
> same as 2).
>
>
> Of course, if I am wasting my time because this is stupid, then I'd value
> any other suggestions on how to deal with this by redesigning the user
> interface.
>
> Thanks.
>
>
> --
> View this message in context:
> http://www.nabble.com/Combining-Ajax-and-non-Ajax-pages-tp15587166p15587166.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]
>
>

Reply via email to