This way you could create a generic Panel component in which you could add
any component at RUNTIME ! ( by altering the markup fragments before
rendering ). 

We are working on a framework project based on Wicket, named SENRO
(http://senro.codehaus.org). We want this to be something like Apple's
WebObjects. But we need to generate dynamic components at runtime, and we
cannot do this now because of the hard-coded checks in the onComponentTag
method. 

Also it would be a great idea to mark the methods checkComponentTag() and
checkComponentTagAttribute() as non final so they could be overriden.

Thanx,
Flavius


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#a8780539
Sent from the Wicket - Dev mailing list archive at Nabble.com.

Reply via email to