You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2016/03/14 22:43:19 UTC

[10/13] wicket git commit: Use GenericPanel to set the type of a Panel used in a test. Remove useless casts

Use GenericPanel to set the type of a Panel used in a test. Remove useless casts


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/23eab221
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/23eab221
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/23eab221

Branch: refs/heads/master
Commit: 23eab221bd3207dda8a45e5e57baba5d746ab42f
Parents: 4b51d3d
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Mar 14 21:04:14 2016 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Mar 14 22:42:55 2016 +0100

----------------------------------------------------------------------
 .../form/onFormValidateModelObjects/AddressFormPanel.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/23eab221/wicket-core/src/test/java/org/apache/wicket/markup/html/form/onFormValidateModelObjects/AddressFormPanel.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/onFormValidateModelObjects/AddressFormPanel.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/onFormValidateModelObjects/AddressFormPanel.java
index 6fe5059..68b2761 100644
--- a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/onFormValidateModelObjects/AddressFormPanel.java
+++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/onFormValidateModelObjects/AddressFormPanel.java
@@ -20,10 +20,10 @@ import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.form.TextField;
-import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.markup.html.panel.GenericPanel;
 import org.apache.wicket.model.IModel;
 
-public class AddressFormPanel extends Panel
+public class AddressFormPanel extends GenericPanel<AddressFormPanel.ChildModel>
 {
 	public AddressFormPanel(String id, IModel<ChildModel> model)
 	{
@@ -35,13 +35,13 @@ public class AddressFormPanel extends Panel
 	private void setupPanel()
 	{
 		// create the form and add the fields and submit button
-		Form form = new Form("childForm", getDefaultModel())
+		Form<ChildModel> form = new Form<ChildModel>("childForm", getModel())
 		{
 			@Override
 			protected void onValidateModelObjects()
 			{
 				super.onValidateModelObjects();
-				((ChildModel)getModelObject()).setChildValidated(true);
+				getModelObject().setChildValidated(true);
 			}
 		};
 
@@ -60,7 +60,7 @@ public class AddressFormPanel extends Panel
 			@Override
 			public void onSubmit(AjaxRequestTarget target, Form<?> form)
 			{
-				((ChildModel)getPanelInstance().getDefaultModelObject()).submittedCalled(target);
+				getPanelInstance().getModelObject().submittedCalled(target);
 			}
 		});
 	}