Dashboard > People > codesmell > 2008 > Mai > 11 > Wicket ResubmitSafeForm
  codesmell Log In   View a printable version of the current page.  
  Wicket ResubmitSafeForm
Added by Uwe Schaefer, last edited by Uwe Schaefer on Mai 11, 2008
Labels: 

Another little gem:

/**
 * Form that divides submit-events to inital and resubmit. 
 * @author igor vaynberg 
 */
abstract class ResubmitSafeForm extends Form
{
    private boolean submitted;
    private static final long serialVersionUID = 1L;

    public ResubmitSafeForm(final String id)
    {
        super(id);
    }

    public ResubmitSafeForm(final String id, final IModel model)
    {
        super(id, model);
    }

    protected abstract void onInitialSubmit();

    protected abstract void onResubmit();

    protected final void onSubmitted()
    {
        if (!this.submitted)
        {
            onInitialSubmit();
            this.submitted = true;
        }
        else
        {
            onResubmit();
        }
    }
}
Mai 2008
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
             

Wicket DropDownIdChoice
Wicket TextLink

This site is powered by a free Atlassian Confluence Personal Server License. Evaluate Confluence for your organisation or read more about Confluence licensing here.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators