> but I can see that the code is setting the formObject to the right values as the event leaves my code,
> sets the targets, and i know that it then shows up wrong in the page

Maybe a previous input is lurking around? Try calling #clearInput() on your FormComponents when you change the underlying model.

Sven

On 05/03/2013 10:50 PM, Entropy wrote:
I have a panel that consists of several combo boxes that hierarchically allow
selection of an office/org hierarchy.  Mostly the 1st combo filters the
second which filters the third and so forth.

I have a requirement to use this in a fashion that allows multiple
selection.  I am also being charged with modifying it to add a goofy
behavior whereing a particular selection in the first combo box defaults the
values in the 2nd and 3rd and a few other quirks.

The selection code works.  The goofy code works.  They do not, however, work
together, and I can't figure out why.  Neither can my co-worker who knows
wicket better than I do.

If I select hierarchy A, select it, then choose the value in the top box
that triggers the goofy defaulting behavior to select B, I get a sort of
hybrid of A and the goofy B.

I commented out everything in the selection behavior...all it is, is an
empty ajax event, and the bug persists.  yet without the ajax event, if I
don't click the button to select, the goofy behavior works as intended.

Now, showing all the goofy behavior would be...alot of code.  But it
basically some down to modifying the underlying object wrapped by the model
that the controls refer to, and then adding the components to the ajax
target.  For example:

                                formObject.setOrgLvl1L(getOrg1ByCode(code));
                                formObject.setOrgLvl2L(null);
                                formObject.setOrgLvl3L(null);
                                formObject.setOrgLvl4L(null);
[...]
                target.addComponent(structureDropDown);
                target.addComponent(orgLvl1DropDown);
                target.addComponent(orgLvl2DropDown);
                target.addComponent(orgLvl3DropDown);
                target.addComponent(orgLvl4DropDown);

Not all the code, but the code is basically about conditionally deciding to
do some combination of the above.  Does anyone have any ideas?  I know I
haven't probably provided a quality description here, but I can see that the
code is setting the formObject to the right values as the event leaves my
code, sets the targets, and i know that it then shows up wrong in the
page...but only if I ran the selection ajax event just before that
event...even though I commented out all the code in that event.

So I am a little befuddled.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wierd-ajax-thing-tp4658543.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
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

Reply via email to