> I try to replace a TextArea with a HiddenField (or in next step with a
> Panel).
>
> before:
> <textarea wicket:id="messageInput" rows="6" cols="20">Input comes
> here</textarea>
>
> after:
> <input wicket:id="messageInput" type="hidden" />
>
> I added a Behaviour to the TextArea:
>     public void bind(Component c)
>     {
>         target = c;
>
>         HiddenField hiddenField = new HiddenField(target.getId(),
> target.getModel());
>
>         target.replaceWith(hiddenField);
>     }
>
> but get error:
> Component messageInput must be applied to a tag of type 'input', not
> '<textarea cols="20" rows="6" wicket:id="messageInput">' (line 0, column 0)

For many components, Wicket checks whether you attach them to the
correct tags. Sometimes, addmittedly, this is annoying, though the
idea is that it saves you from making stupid mistakes. In this case,
just either use custom components (or one that can do both, this might
actually be a fairly elegant solution) or wrap those components in
panels (TextAreaPanel and HiddenFieldPanel) and use a <span> tag or
something similar.

Eelco

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to