[ 
https://issues.apache.org/jira/browse/WICKET-669?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Igor Vaynberg reassigned WICKET-669:
------------------------------------

    Assignee: Alastair Maw

> AjaxEditableLabel needs Model for adding a IValidator
> -----------------------------------------------------
>
>                 Key: WICKET-669
>                 URL: https://issues.apache.org/jira/browse/WICKET-669
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.0-beta2
>         Environment: Wicket 1.3 trunk as of 2007-06-17
> Jetty 6
> JDK 1.6
>            Reporter: RĂ¼diger Schulz
>            Assignee: Alastair Maw
>            Priority: Minor
>             Fix For: 1.3.0-beta4
>
>
> If you add a IValidator to a AjaxEditableLabel which has no model yet, one 
> gets the following Exception:
> java.lang.IllegalStateException: No model found for this component, either 
> pass one explicitly or make sure an inheritable model is available. This 
> component is not added to a parent yet, so if this component is supposed to 
> use the model of the parent (e.g. when it uses a compound property model), 
> add it first before further configuring the component calling methods like 
> e.g. setType and addValidator.
>      at 
> org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.getParentModel(AjaxEditableLabel.java:450)
>      at 
> org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.getEditor(AjaxEditableLabel.java:310)
>      at 
> org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.add(AjaxEditableLabel.java:194)
> The error message is very clear. There should be a small hint in the JavaDoc 
> for add(IValidator):
> /**
>  * Adds a validator to this form component.
>  * A model must be available for this component before Validators
>  * can be added. Either add this Component to its parent (already 
>  * having a Model), or provide one directly before this call
>  * via constructor [EMAIL PROTECTED] #AjaxEditableLabel(String,IModel)} or 
>  * [EMAIL PROTECTED] #setModel(IModel)}.
>  * 
>  * @param validator
>  *            The validator
>  * @return This
>  */

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to