You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Arthur Leigh Allen <ar...@yahoo.de> on 2009/02/03 23:54:45 UTC

2 DropDownChoices with a renderer. ajax update

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


      

Re: 2 DropDownChoices with a renderer. ajax update

Posted by Sasha Newbie <mo...@yahoo.com.ar>.
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


AW: AW: AW: 2 DropDownChoices with a renderer. ajax update

Posted by Arthur Leigh Allen <ar...@yahoo.de>.
sorry i meant:
neither the getIdValue nor the getDisplayValue are called 




________________________________
Von: Arthur Leigh Allen <ar...@yahoo.de>
An: users@wicket.apache.org
Gesendet: Mittwoch, den 4. Februar 2009, 10:57:28 Uhr
Betreff: AW: AW: 2 DropDownChoices with a renderer. ajax update

it seems to me like the drop down choice is not retrieving the new data from the renderer.
whether the getIdValue nor the getDisplayValue are called to retrieve the new data when redrawing the drop down choice.
does the drop down choice cache the first renderer results?




________________________________
Von: Arthur Leigh Allen <ar...@yahoo.de>
An: users@wicket.apache.org
Gesendet: Mittwoch, den 4. Februar 2009, 09:24:39 Uhr
Betreff: AW: 2 DropDownChoices with a renderer. ajax update

i already saw that example igor but the difference is that they're using a property model and they override the getObject method while I'm using a renderer for the state choice and i'm updating my renderer data but nothing happen. i need a renderer because i need both, a (database) key and a (language specific) value. in that example only the values are set.

best regards
leigh



________________________________
Von: Igor Vaynberg <ig...@gmail.com>
An: users@wicket.apache.org
Gesendet: Mittwoch, den 4. Februar 2009, 00:24:08 Uhr
Betreff: Re: 2 DropDownChoices with a renderer. ajax update

see here for clues

http://wicketstuff.org/wicket13/ajax/choice.1

-igor

On Tue, Feb 3, 2009 at 2:54 PM, Arthur Leigh Allen
<ar...@yahoo.de> 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
>
>
>

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


      

AW: AW: 2 DropDownChoices with a renderer. ajax update

Posted by Arthur Leigh Allen <ar...@yahoo.de>.
it seems to me like the drop down choice is not retrieving the new data from the renderer.
whether the getIdValue nor the getDisplayValue are called to retrieve the new data when redrawing the drop down choice.
does the drop down choice cache the first renderer results?




________________________________
Von: Arthur Leigh Allen <ar...@yahoo.de>
An: users@wicket.apache.org
Gesendet: Mittwoch, den 4. Februar 2009, 09:24:39 Uhr
Betreff: AW: 2 DropDownChoices with a renderer. ajax update

i already saw that example igor but the difference is that they're using a property model and they override the getObject method while I'm using a renderer for the state choice and i'm updating my renderer data but nothing happen. i need a renderer because i need both, a (database) key and a (language specific) value. in that example only the values are set.

best regards
leigh



________________________________
Von: Igor Vaynberg <ig...@gmail.com>
An: users@wicket.apache.org
Gesendet: Mittwoch, den 4. Februar 2009, 00:24:08 Uhr
Betreff: Re: 2 DropDownChoices with a renderer. ajax update

see here for clues

http://wicketstuff.org/wicket13/ajax/choice.1

-igor

On Tue, Feb 3, 2009 at 2:54 PM, Arthur Leigh Allen
<ar...@yahoo.de> 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
>
>
>

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


      

AW: 2 DropDownChoices with a renderer. ajax update

Posted by Arthur Leigh Allen <ar...@yahoo.de>.
i already saw that example igor but the difference is that they're using a property model and they override the getObject method while I'm using a renderer for the state choice and i'm updating my renderer data but nothing happen. i need a renderer because i need both, a (database) key and a (language specific) value. in that example only the values are set.

best regards
leigh



________________________________
Von: Igor Vaynberg <ig...@gmail.com>
An: users@wicket.apache.org
Gesendet: Mittwoch, den 4. Februar 2009, 00:24:08 Uhr
Betreff: Re: 2 DropDownChoices with a renderer. ajax update

see here for clues

http://wicketstuff.org/wicket13/ajax/choice.1

-igor

On Tue, Feb 3, 2009 at 2:54 PM, Arthur Leigh Allen
<ar...@yahoo.de> 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
>
>
>

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


      

Re: 2 DropDownChoices with a renderer. ajax update

Posted by Igor Vaynberg <ig...@gmail.com>.
see here for clues

http://wicketstuff.org/wicket13/ajax/choice.1

-igor

On Tue, Feb 3, 2009 at 2:54 PM, Arthur Leigh Allen
<ar...@yahoo.de> 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
>
>
>

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