if you want you can even create a mapping yourself using a map, so you have
input type="text" -> textfield
textarea -> textarea
input type="checkbox" -> checkbox
but for beanpanels it is probably the cleanest to create a panel for every
kind of editor, that way you can have a panel for complex types that do not
cleanly map onto html, like a phone editor field that has 3 text fields
-igor
On 2/3/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
this wont work. some components react differently based on what tag they
are attached to.
take link. if attached to anchor it generates an href, if attached to
input submit it generates an onclick.
what you are suggesting is not future proof and i dont think we will
implement it.
-igor
On 2/3/07, Flavius Burca <[EMAIL PROTECTED]> wrote:
>
>
> Yes, I know this, but the idea is not to wrap components in panels. My
> idea
> is to create an empty Panel in which you can add any kind of component
> at
> runtime ! This cannot be acheived right now because the onComponentTag()
>
> method for standard components check to see if the HTML tag is suitable
> for
> it (eg. checkComponentTag(tag, "input"); ).
> I need to know what kind of tag the component wants, before the
> component's
> onComponentTag method is called. This way i can dynamically generate the
> component's markup and add it to the empty panel at runtime. In this way
> you
> don't need to wrap the components in panels. The component's tag will be
>
> automatically generated.
>
>
>
> igor.vaynberg wrote:
> >
> > if you are building a bean panel what you can do is wrap the
> components in
> > a
> > panel, and then insert the panel instead.
> >
> > so have a TextFieldPanel that wraps a textfield and feeds it the
> markup
> > <wicket:panel><input wicket:id="tf" type="text"/></wicket:panel>
> >
> > does that not work for you?
> >
> > also see wicket-contrib-beanpanel or something like that in
> wicket-stuff
> >
> > -igor
> >
> >
> > On 2/3/07, Flavius Burca <[EMAIL PROTECTED] > wrote:
> >>
> >>
> >> 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.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/onComponentTag-hard-coded-checks-tf3165160.html#a8786616
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>