I have an AjaxButton that nulls a model value like this:

       Button deactivate_button = new AjaxButton("deactivate_button")
            {
            @Override
            protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                {
System.out.println("deactivating.");
                _activation_user.setObject(null);
                target.add(activation_user_label);
                }
...
private Model<String> _activation_user = new Model<String>();

The println statement appears in the logs, so I know this code is being
called.  (the activation_user_label displays _activation_user).

But then in the form's onSubmit() method, the value of the _activation_user
model is reverted to the original value - i.e. it is not null as it should
be. I also observe this via a println().

Here's the part that has me very puzzled - this is code that has been
working for more than a year - the problem started when we upgraded to
Wicket 6. It works fine in my development environment. It does not work
when deployed to AppEngine. This issue is a subset of the problems I
mentioned in a previous post (Google AppEngine Initializer and Wicket 6). I
decided to pick one of the problems and try to dig as deep as I could into
it. Unfortunately, debugging it has been frustrating since I can't
reproduce it locally...I've been reduced to system.out.println()s :(

There is only one form on the page and virtually the entire page is in it,
including the AjaxButton referenced above. I have a similar problem on
another page where an Ajax event listener is enabling a button, but
pressing the button results in a Wicket error complaining that the button
is not enabled. In both cases, it appears that the state of the page has
been "reset" to it's previous state after the ajax event is done...or that
the second form submission is directed at the previous copy of the page
state, rather than the post-ajax submission state. Does that make any sense
to anyone? I understand there were a lot of changes with Ajax handling in
Wicket 5-6 and I'm not at all confident that I have made all the necessary
code changes on our end to adapt to that (though I seem to recall reading
that those changes should be minimal). Is there anything in the Wicket
environment that we may have customized back in the Wicket 4 days for
AppEngine that might induce this type of behavior? Something related to how
Wicket stores/retrieves page state?

I'm grasping at straws here, especially without the ability to step into
the Wicket code:(   Any advice is greatly appreciated!

I think my next direction is going to be to attempt to code a page from
scratch that exhibits this behavior...that should, at the least, make for
an easier example to show. If anyone has any better ideas...

TIA!
Chris

Reply via email to