Hi Andrea,
Here is form.onSubmit() functionality, as well as the panel swap
functionality and how I call it. It is pretty much all the functionality I
use:

public class CreateEditPersonPanel extends Panel {
   private WebPage parentPage;
   public CreatePersonPanel(String id, WebPage parentPage) {
      super(id); 
      this.parentPage = parentPage;
      add( new PersonForm( "genericPersonCreationForm", (IModel<Person>)
getDefaultModel() ) );
  }
   ...
   private void callViewPersonPanel(Long personID){     
      //get parent page, pane container
      parentPage.replaceCurrentPanelWithViewPerson(personID);
   }
   ...
   private class PersonForm extends SubmitOnceForm<Person> {
      @Override
      protected void onSubmit() {
         WicketApplication.get().getPersons_service().savePerson(person);
         callViewPersonPanel(person.getId());
     }   
  }
}
And on the Parent page I have the following functionality:
 public class ParentPage extends WebPage { 
...
   public void replaceCurrentPanelWithViewPerson(long personID){
        viewGenericPersonPanel = new ViewGenericPersonPanel("mainPanel", 
personID);
        currentPanel.replaceWith(viewGenericPersonPanel);
        currentPanel = viewGenericPersonPanel;
   }
}

I'm sorry I cannot spot where I might have gone wrong. 
Thanks for your help,
Lucas

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

Reply via email to