Probably your form is removed from component hierarchy when it is submitted.That's why you don't get exceptions if you call get page before form processing. When does your code replace panel? What's inside form's onSubmit method?
Hi Andrea,
Thanks for your reply.
I call updateProcessedForms() AND THEN super.process(submittingComponent).
The reverse order to what it is shown on pg 49 on book. I described it wrong
on original post, I apologise. It is now corrected.

When calling createPerson Panel, I execute the following in order to create
new instance of person variables:
public CreatePersonPanel(String id, WebPage parentPage){
                super(id);
                setDefaultModel(new Model<Person>(new Person(new
PersonCreatedTimestamp()));
                add( new PersonForm( "personCreationForm", (IModel<Person>)
getDefaultModel() ) );
                 ...
        }
And for editing I do the following:

public CreatePersonPanel(String id, Long personId , WebPage parentPage){
        super( id, new LoadablePersonModel(personId) );
        this.parentPage = parentPage;
         add( new PersonForm( "personCreationForm", (IModel<Person>)
getDefaultModel() ) );
        ...
        }

Inside the form, I get a copy of the default model object:
public EventForm(String id, IModel<Person>  model) {
                        super(id, model);
                         person = (Person) this.getDefaultModel().getObject();
...
}
When submitting the form, I simply call the following service passing the
person object I extracted from the default model, as shown above:
WicketApplication.get().getPersons_service().savePerson(person);

The only place where I create a new instance of person is when I first call
the createPersonPanel.
I hope this helps. Thanks for looking into it.
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3535415.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