Also to note that I am talking about Wicket 2.0 !.

Flavius Burca wrote:
> 
> In each basic component like Check, CheckBox, CheckGroupSelector,
> DropDownChoice, Form, FormComponentLabel, Radio, Textfield etc, checks are
> performed in the onComponentTag method:
> 
> example:
>                checkComponentTag(tag, "input");
>                checkComponentTagAttribute(tag, "type", "checkbox");
> 
> and the checkComponentTag() and checkComponentTagAttribute() methods are
> marked as final. So basically you cannot alter a default's component
> behaviour because you don't know from the component's class what kind of
> tag and attributes check it does.
> 
> So, please make the values you check against readable as static fields in
> those classes. For example: 
> 
> TextField:
> 
>                  public static String HTML_TAG = "input"
>                  public static String HTML_TAG_ATTRIBUTES[][] = new
> String[][] {
>                                             {"type", "text"}
>                  };
> 
> and the onComponentTag becomes:
> 
>                    checkComponentTag(tag, HTML_TAG);
> 
> This way, you could create generic components and you could know what kind
> of HTML tag a component expects and what tag attributes it expects.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/onComponentTag-hard-coded-checks-tf3165160.html#a8780545
Sent from the Wicket - Dev mailing list archive at Nabble.com.

Reply via email to