Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
1.3.5, 1.4-RC1, 1.4-RC2
-
None
Description
in following code, onSubmit is called twice, model is erased on second submit:
----------------------------------------------------------------
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.apache.wicket.extensions.markup.html.form.palette.Palette;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.ChoiceRenderer;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
public class TestPalettePage extends WebPage
{
enum TestEnum
;
IModel<List<TestEnum>> _model=(IModel<List<TestEnum>>)(new Model(new ArrayList(Arrays.asList(TestEnum.values()))));
IModel<Collection<TestEnum>> _choices=(IModel<Collection<TestEnum>>)(new Model(new ArrayList(Arrays.asList(TestEnum.values()))));
public TestPalettePage()
{
Form form=new Form("form")
{
@Override
protected void onSubmit()
};
ChoiceRenderer<TestEnum> choiceRenderer=new ChoiceRenderer<TestEnum>("name","ordinal");
Palette<TestEnum> palette=new Palette<TestEnum>("palette",_model,_choices,choiceRenderer,3,true);
form.add(palette);
form.add(new Button("submit"));
add(form);
}
}
-------------------------------------------------------