From: Sven Meier <s...@meiers.net>
Subject: Re: Ajax has too much control?
To: users@wicket.apache.org
Date: Sunday, March 21, 2010, 7:25 AM
Hi David,
DropDownChoice#wantOnSelectionChangedNotifications() will
trigger
rendering of the complete page.
On Ajax request only those components are rendered you
explicitely 'add'
to the request, see AjaxRequestTarget#addComponent().
If you want to have the same for Ajax requests, you can
just 'add' the
complete page.
This is not very efficient though.
Sven
David Chang wrote:
Forgive me about this meaningless subject, but I
cannot think of a better one.
I have been learning Wicket through the WIA book. I
just found out something interesting to me. Not sure it is a
bug, design, or something I did wrong.
I have a page with three Wicket elements:
1. Locale selector through a DropDownChoice list. WIA
has complete code about how this works and I copied the
solution into this page
2. Country DropDownChoice, whose values change between
English and Chinese depending on Locale DDC.
3. State DropDownChoice, whose values change between
English and Chinese depending on Locale DDC. The values in
this DDC depends on the chosen value in Country DDC.
Here are the experiments
Experiment#1.
Country DDC does not control values in State DDC via
Ajax and it has
protected boolean
wantOnSelectionChangedNotifications() {
return true;
}
Everything works like a charm, which means
(1) when Country DDC value changes, State DDC changes
accodingly.
(2) when Locale changes, both Country DDC and State
DDC lists change display values accordingly (which means
both DDCs show a list of values in the same language).
Experiment#2.
Country DDC controls values in State DDC via Ajax. In
this case, when page is first loaded, I do not touch the
Country DDC or State DDC. I simply change locale value any
number of times, both Country DDC and State DDC lists change
correctly depending on the session locale. Here is the
strange thing. Then I change Country DDC value, State DDC
changes correctly. Since then, HOWEVER, if I change locale
values, ONLY Country DDC list changes correctly; State DDC
list is not updated. It seems Wicket decides that State DDC
is forever Aja-controlled by Country DDC only.
Not qure sure if this a bug, design, or I did
something wrong.
Please let me if you have difficulty understanding the
experiments.
Thanks for any info or help.
Cheers!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org