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 <[email protected]> An: [email protected] 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 <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
