You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Markus Bohl <Ma...@brandad-systems.de> on 2010/10/18 10:20:55 UTC

Treat Label and InputFields as one unit

Hi all,

we are currently developing a Wicket application and often face the same situation: We want to treat an input-component (Textfield, Textarea, Dropdown, etc.) with a corresponding Label as one unit.

For example, we have a label showing the text "Name:" and next to it a textfield where one can enter that name. When there is a need to make both components invisible, for example, we have to invoke the setVisible(false) method on both components.

Is there a way to handle this more elegantly? Maybe something like a "LabeledTextField" (a constructor may look like new LabeledTextField(String id, String label, IModel model))? And if not, what would be the best way to implement it? Subclassing the InputField or putting both components together in a panel?

Thank you in advance for your answers.

Markus

AW: Treat Label and InputFields as one unit

Posted by Markus Bohl <Ma...@brandad-systems.de>.
Hi Martijn,

I did't know about this tag. Thank you.

Markus

-----Ursprüngliche Nachricht-----
Von: Martijn Dashorst [mailto:martijn.dashorst@gmail.com] 
Gesendet: Montag, 18. Oktober 2010 13:45
An: users@wicket.apache.org
Betreff: Re: Treat Label and InputFields as one unit

See the wicket:enclosure tag

Martijn

On Mon, Oct 18, 2010 at 10:20 AM, Markus Bohl
<Ma...@brandad-systems.de> wrote:
> Hi all,
>
> we are currently developing a Wicket application and often face the same situation: We want to treat an input-component (Textfield, Textarea, Dropdown, etc.) with a corresponding Label as one unit.
>
> For example, we have a label showing the text "Name:" and next to it a textfield where one can enter that name. When there is a need to make both components invisible, for example, we have to invoke the setVisible(false) method on both components.
>
> Is there a way to handle this more elegantly? Maybe something like a "LabeledTextField" (a constructor may look like new LabeledTextField(String id, String label, IModel model))? And if not, what would be the best way to implement it? Subclassing the InputField or putting both components together in a panel?
>
> Thank you in advance for your answers.
>
> Markus
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Treat Label and InputFields as one unit

Posted by Martijn Dashorst <ma...@gmail.com>.
See the wicket:enclosure tag

Martijn

On Mon, Oct 18, 2010 at 10:20 AM, Markus Bohl
<Ma...@brandad-systems.de> wrote:
> Hi all,
>
> we are currently developing a Wicket application and often face the same situation: We want to treat an input-component (Textfield, Textarea, Dropdown, etc.) with a corresponding Label as one unit.
>
> For example, we have a label showing the text "Name:" and next to it a textfield where one can enter that name. When there is a need to make both components invisible, for example, we have to invoke the setVisible(false) method on both components.
>
> Is there a way to handle this more elegantly? Maybe something like a "LabeledTextField" (a constructor may look like new LabeledTextField(String id, String label, IModel model))? And if not, what would be the best way to implement it? Subclassing the InputField or putting both components together in a panel?
>
> Thank you in advance for your answers.
>
> Markus
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org