You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Doug Leeper <do...@yahoo.com> on 2011/07/26 03:45:10 UTC

DropDownChoice and preserving current page parameters

I have a "navigation area" that drives the amount of content on a DataView. 
One of these navigating components is a DropDownChoice which drives the
number of rows to be displayed in the DataView.  This page is to be
stateless and is mounted as such:

mount(new MixedParamUrlCodingStrategy("/categoryListings",
				CategoryListingPage.class, new String[] { "category" }));

My DDC is implemented as:

DropDownChoice pageChoice = new DropDownChoice<Integer>(
					"rowsPerPage", new PropertyModel(ListingsByCategory.this,
							"displayResults"), rowsPerPageVals) {

				@Override
				protected void onSelectionChanged(Integer newSelection) {
					System.out.println("HERE: " + newSelection);
					dataView.setItemsPerPage(displayResults);
					PageParameters params = new PageParameters();
					params.add("category", categoryId.toString());
					params.add("itemsPerPage", String.valueOf(displayResults));

					setResponsePage(getPage().getClass(), params);
				}

				@Override
				protected boolean wantOnSelectionChangedNotifications() {
					return true;
				}

				@Override
				protected boolean getStatelessHint() {
					return true;
				}

			};

The issue I am having is that the DDC.onComponentTag() isn't preserving the
bookmarkable parameters.


I am almost positive that this was occurring on a previous version of Wicket
(I am currently using 1.4.17).

Also, my onSelectionChanged(Integer val) is not being called (as evident by
the missing "HERE" in my output)

Has anyone else experienced this issue?

Thanks
- Doug

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-and-preserving-current-page-parameters-tp3694641p3694641.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: DropDownChoice and preserving current page parameters

Posted by Doug Leeper <do...@yahoo.com>.
figured it out:

My page hierarchy was not passing the PageParameters up the constructor
chain.

Additionally, I had to remove the containing form for the DropDownChoice.

I swear this worked before...but I am not sure when it changed.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-and-preserving-current-page-parameters-tp3694641p3694687.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org