Here's the deal: I've got a class that extends AbstractAjaxBehavior. It's got an instance on a Page, where one of its methods is overriden, tying its output to an object (or a model of it) that is the model for a form. I want that method's output to change when the form is submitted, reflecting the form's newly submitted values. What I want to update, based on a form, is something similar to this:
final MyAjaxBehavior myBehavior = new MyAjaxBehavior(){
@Override
protected String getName(){
return form.getModelObject().getName();
}
}
I can get it to work on the first form submit, but if the form's fields are changed and it is submitted again, though the rest of the page is updated, the behavior isn't.
I'm not really well-versed on models' inner workings, so I'm at a loss here.
Thanks!
EDIT: just to clarify, since Behaviors aren't usually employed like this, the Behavior I'm using is actually this thing. I'm overwriting getFileName(), and I want it to take into account changes in form model.