Class AutoLabelTextResolver
- java.lang.Object
-
- org.apache.wicket.markup.html.form.AutoLabelTextResolver
-
- All Implemented Interfaces:
Serializable
,IComponentResolver
,IClusterable
public class AutoLabelTextResolver extends Object implements IComponentResolver
Resolver that provides the<wicket:label>
tag, which will output a FormComponent'slabel
without requiring a manual extra component such asLabel
orFormComponentLabel
.<wicket:label>
can be used- together with
<label wicket:for="...">
:<label wicket:for="myFormComponent">some other markup, optionally<wicket:label/></label>
-
standalone, with a
for
attribute:<wicket:label for="myFormComponent"/>
It also supports both input and output:
- If the FormComponent has a label model, the
<wicket:label>
tag will be replaced by the contents of that label. - If the FormComponent's label model is null, it can be picked up from
<wicket:label>
:<wicket:label>
can contain some raw markup, like this:<wicket:label>I will become the component's label!</wicket:label>
- Or it can be a message pulled from resources, similar to
<wicket:message/>
:<wicket:label key="messagekey"/>
- Author:
- Carl-Eric Menzel, igor
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AutoLabelTextResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Component
resolve(MarkupContainer container, MarkupStream markupStream, ComponentTag tag)
Try to resolve a component.
-
-
-
Field Detail
-
LABEL
public static final String LABEL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AutoLabelTextResolver
public AutoLabelTextResolver()
-
-
Method Detail
-
resolve
public Component resolve(MarkupContainer container, MarkupStream markupStream, ComponentTag tag)
Description copied from interface:IComponentResolver
Try to resolve a component.- Specified by:
resolve
in interfaceIComponentResolver
- Parameters:
container
- The container parsing its markupmarkupStream
- The current markupStreamtag
- The current component tag while parsing the markup- Returns:
- component or
null
if not found
-
-