[seam-commits] Seam SVN: r8886 - trunk/examples/wicket/src/web/org/jboss/seam/example/wicket.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Sep 3 13:30:41 EDT 2008


Author: pete.muir at jboss.org
Date: 2008-09-03 13:30:41 -0400 (Wed, 03 Sep 2008)
New Revision: 8886

Modified:
   trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.java
   trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/FormInputBorder.java
Log:
JBSEAM-3321

Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.java
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.java	2008-09-03 16:20:09 UTC (rev 8885)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.java	2008-09-03 17:30:41 UTC (rev 8886)
@@ -119,19 +119,8 @@
             setResponsePage(Confirm.class);
          }
       }
-      
-      @Override
-      public Component add(IBehavior behavior)
-      {
-         // TODO Auto-generated method stub
-         return super.add(behavior);
-      }
+
 	   
 	}
 	
-	@Override
-	protected void onBeforeRender()
-	{
-	   super.onBeforeRender();
-	}
 }

Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/FormInputBorder.java
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/FormInputBorder.java	2008-09-03 16:20:09 UTC (rev 8885)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/FormInputBorder.java	2008-09-03 17:30:41 UTC (rev 8886)
@@ -2,10 +2,11 @@
 
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.feedback.ContainerFeedbackMessageFilter;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.border.Border;
 import org.apache.wicket.markup.html.form.FormComponent;
-import org.apache.wicket.markup.html.panel.ComponentFeedbackPanel;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
@@ -29,7 +30,9 @@
 public class FormInputBorder extends Border
 {
 
-   private ComponentFeedbackPanel feedbackPanel;
+   private FeedbackPanel feedbackPanel;
+   private boolean ajaxValidate;
+   private Model labelModel;
    
    /**
     * Create a new form input border which validates using ajax
@@ -69,7 +72,9 @@
    public FormInputBorder(String id, String label, FormComponent component, IModel model, boolean ajaxValidate, Class modelClass, String propertyExpression)
    {
       super(id);
-      component.setLabel(new Model(label));
+      this.ajaxValidate = ajaxValidate;
+      labelModel = new Model(label);
+      component.setLabel(labelModel);
       if (component.isRequired())
       {
          label += ":*";
@@ -80,11 +85,22 @@
       }
       Label labelComponent = new Label("label", label);
       add(labelComponent);
+      feedbackPanel = new FeedbackPanel("message", new ContainerFeedbackMessageFilter(this));
       add(component, model, modelClass, propertyExpression);
-      feedbackPanel = new ComponentFeedbackPanel("message", component);
-      
       add(feedbackPanel);
-      
+   }
+   
+   public FormInputBorder add(FormComponent component, PropertyModel model)
+   {
+      return add(component, model, model.getTarget().getClass(), model.getPropertyExpression());
+   }
+   
+   public FormInputBorder add(FormComponent component, IModel model, Class modelClass, String expression)
+   {
+      component.add(new ModelValidator(modelClass, expression));
+      component.setModel(model);
+      component.setLabel(labelModel);
+      add(component);
       if (ajaxValidate)
       {
          feedbackPanel.setOutputMarkupId(true);
@@ -112,18 +128,6 @@
             
          });
       }
-   }
-   
-   public FormInputBorder add(FormComponent component, PropertyModel model)
-   {
-      return add(component, model, model.getTarget().getClass(), model.getPropertyExpression());
-   }
-   
-   public FormInputBorder add(FormComponent component, IModel model, Class modelClass, String expression)
-   {
-      component.add(new ModelValidator(modelClass, expression));
-      component.setModel(model);
-      add(component);
       return this;
    }
 




More information about the seam-commits mailing list