You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by eh...@apache.org on 2007/06/05 21:23:29 UTC
svn commit: r544602 -
/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java
Author: ehillenius
Date: Tue Jun 5 12:23:29 2007
New Revision: 544602
URL: http://svn.apache.org/viewvc?view=rev&rev=544602
Log:
javadoc
Modified:
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java
Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java?view=diff&rev=544602&r1=544601&r2=544602
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponentPanel.java Tue Jun 5 12:23:29 2007
@@ -34,9 +34,21 @@
* outside world as one component, but internally uses separate components. This
* component would then use these nested components to handle it's internal
* state, and would use that internal state to get to one model object.
+ * <p>
+ * It is recommended that you override {@link #getConvertedInput()} and let it
+ * return the value that represents the compound value of the nested components.
+ * This value will then be set as the model value of the component. Often, this
+ * goes hand-in-hand with overriding {@link #onBeforeRender()}, where you would
+ * analyse the model value, break it up and distribute the appropriate values
+ * over the child components.
+ * </p>
*
+ * <p>
* Here is a simple example of a panel with two components that multiplies and
- * sets that as the master model object.
+ * sets that as the master model object. Note that for this simple example,
+ * setting the model value wouldn't make sense, as the lhs and rhs cannot be
+ * known. For more complete examples of using this class, see the
+ * wicket-datetime project.
*
* <pre>
* public class Multiply extends FormComponentPanel
@@ -58,14 +70,11 @@
* init();
* }
*
- * public void updateModel()
+ * public Object getConvertedInput()
* {
- * // childs are currently updated *after* this component,
- * // so if we want to use the updated models of these
- * // components, we have to trigger the update manually
- * left.updateModel();
- * right.updateModel();
- * setModelObject(new Integer(lhs * rhs));
+ * Integer lhs = (Integer)left.getConvertedInput();
+ * Integer rhs = (Integer)right.getConvertedInput();
+ * return lhs * rhs;
* }
*
* private void init()
@@ -99,6 +108,8 @@
* <span wicket:id="multiply">[multiply]</span>
* = <span wicket:id="multiplyLabel">[result]</span>
* </pre>
+ *
+ * </p>
*
* @author eelcohillenius
*/