You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sasha Newbie <mo...@yahoo.com.ar> on 2009/04/08 17:32:21 UTC

Re: 2 DropDownChoices with a renderer. ajax update

Dear Arthur,

I had to do the same thing but I did not use a ChoiceRenderer or anything. I
have three DropDownChoice and each one needs to be updated according to the
option selected in the previous DropDown.
I had the same problem and I solved it adding a setChoices(List) to the
DropDown. I had forgotten to do that, and of course, when the page was
rendered, my DropDown always looked the same way.
I don't know whether this was your original doubt, but I spent a lot of time
trying to figure this out... I hope this might have helped you!
Best regards,

Sasha (newbie)



Arthur Leigh Allen wrote:
> 
> Hello people,
> 
> thanks for helping the newbies in wicket.
> 
> I got one more question:
> -I use two drop down choices
> -The first one includes all countries, the second one the related states
> -If the first country choice changed, the second one should be updated via
> ajax
> -In both choices i use a choice renderer which implements IChoiceRenderer
> -When the country choice was selected, the related states are retrieved
> from the database and set in the state renderer
> -Then the state choice is added to the target object in on change event
> -In my browser I can see that the state drop down choice was redrawed but
> the retrieved states are not send to the browser (proved in wicket ajax
> debug)
> 
> I tried a lot of things but nothing could solve my problem.
> Does someone have an advice for me???
> 
> The states are definetly retrieved correctly from the database.
> In wicket examples I saw that PropertyModel is used and the getObject
> method is overridden.
> I'm using a ChoiceRenderer because I need a key and a value.
> The DropDownChoices are working correctly. The only problem is that they
> are not redrawed correctly.
> 
> Note: The initial status is that the country renderer is filled with about
> 150 countries. The state renderer is empty. The states should be filled
> when a country was selected. I tested the state choice by initializing it
> with the states for Germany. The states were shown correctly. Then when I
> select a different country with no states available, the state choice will
> be emptied (but the place of the already showed states is reserved as a
> white rectangle). When I select Germany again the states are shown again
> correctly. But when the initial status of state choice is empty, nothing
> happend when switching between different countries.
> 
> It seems to me like wicket is not updating the view correctly. Do I have
> to send an refresh or update signal to the state choice or something
> similar?
> 
> Thanks in advance
> Leigh
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/2-DropDownChoices-with-a-renderer.-ajax-update-tp21820789p22953022.html
Sent from the Wicket - User 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