You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by gs...@apache.org on 2008/04/05 23:03:06 UTC

svn commit: r645177 - in /wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html: AjaxEditableChoiceLabel.java AjaxEditableMultiLineLabel.java

Author: gseitz
Date: Sat Apr  5 14:02:53 2008
New Revision: 645177

URL: http://svn.apache.org/viewvc?rev=645177&view=rev
Log:
WICKET-1239: delegate onModelChanged, onModelChanging from the editor to AjaxEditable*Label

Modified:
    wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableChoiceLabel.java
    wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableMultiLineLabel.java

Modified: wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableChoiceLabel.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableChoiceLabel.java?rev=645177&r1=645176&r2=645177&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableChoiceLabel.java (original)
+++ wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableChoiceLabel.java Sat Apr  5 14:02:53 2008
@@ -33,7 +33,7 @@
 /**
  * And inplace editor much like {@link AjaxEditableLabel}, but instead of a {@link TextField} a
  * {@link DropDownChoice} is displayed.
- *
+ * 
  * @author Eelco Hillenius
  */
 public class AjaxEditableChoiceLabel extends AjaxEditableLabel
@@ -48,7 +48,7 @@
 
 	/**
 	 * Construct.
-	 *
+	 * 
 	 * @param id
 	 *            The component id
 	 */
@@ -59,7 +59,7 @@
 
 	/**
 	 * Construct.
-	 *
+	 * 
 	 * @param id
 	 *            The component id
 	 * @param model
@@ -72,7 +72,7 @@
 
 	/**
 	 * Construct.
-	 *
+	 * 
 	 * @param id
 	 *            The component id
 	 * @param choices
@@ -85,7 +85,7 @@
 
 	/**
 	 * Construct.
-	 *
+	 * 
 	 * @param id
 	 *            The component id
 	 * @param model
@@ -101,7 +101,7 @@
 
 	/**
 	 * Construct.
-	 *
+	 * 
 	 * @param id
 	 *            The component id
 	 * @param model
@@ -120,7 +120,7 @@
 
 	/**
 	 * Construct.
-	 *
+	 * 
 	 * @param id
 	 *            The component id
 	 * @param model
@@ -135,7 +135,7 @@
 
 	/**
 	 * Construct.
-	 *
+	 * 
 	 * @param id
 	 *            The component id
 	 * @param model
@@ -157,7 +157,7 @@
 	 */
 	protected FormComponent newEditor(MarkupContainer parent, String componentId, IModel model)
 	{
-		DropDownChoice editor = new DropDownChoice(componentId, model, new AbstractReadOnlyModel()
+		IModel choiceModel = new AbstractReadOnlyModel()
 		{
 
 			private static final long serialVersionUID = 1L;
@@ -167,7 +167,22 @@
 				return choices.getObject();
 			}
 
-		}, renderer);
+		};
+		DropDownChoice editor = new DropDownChoice(componentId, model, choiceModel, renderer)
+		{
+			private static final long serialVersionUID = 1L;
+
+			protected void onModelChanged()
+			{
+				AjaxEditableChoiceLabel.this.onModelChanged();
+			}
+
+			protected void onModelChanging()
+			{
+				AjaxEditableChoiceLabel.this.onModelChanging();
+			}
+
+		};
 		editor.setOutputMarkupId(true);
 		editor.setVisible(false);
 		editor.add(new EditorAjaxBehavior()
@@ -187,5 +202,15 @@
 			}
 		});
 		return editor;
+	}
+
+	protected void onModelChanged()
+	{
+		super.onModelChanged();
+	}
+
+	protected void onModelChanging()
+	{
+		super.onModelChanging();
 	}
 }

Modified: wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableMultiLineLabel.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableMultiLineLabel.java?rev=645177&r1=645176&r2=645177&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableMultiLineLabel.java (original)
+++ wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/AjaxEditableMultiLineLabel.java Sat Apr  5 14:02:53 2008
@@ -111,7 +111,20 @@
 	 */
 	protected FormComponent newEditor(MarkupContainer parent, String componentId, IModel model)
 	{
-		TextArea editor = new TextArea(componentId, model);
+		TextArea editor = new TextArea(componentId, model)
+		{
+			private static final long serialVersionUID = 1L;
+
+			protected void onModelChanged()
+			{
+				AjaxEditableMultiLineLabel.this.onModelChanged();
+			}
+
+			protected void onModelChanging()
+			{
+				AjaxEditableMultiLineLabel.this.onModelChanging();
+			}
+		};
 		editor.add(new AttributeModifier("rows", new AbstractReadOnlyModel()
 		{
 			private static final long serialVersionUID = 1L;
@@ -209,5 +222,15 @@
 	protected String defaultNullLabel()
 	{
 		return "...";
+	}
+
+	protected void onModelChanged()
+	{
+		super.onModelChanged();
+	}
+
+	protected void onModelChanging()
+	{
+		super.onModelChanging();
 	}
 }