Description
Copied from the following thread:
http://www.nabble.com/Issues+with+Label+Components+with+Tapestry+4.0-p4576155.html
<issue>
I'm overriding ValidationDelegate in order to add required field
indicators. I used to be pre-pending an asterisk to the beginning of
the field, and I had that working. Now I want to add <span class="req">
to the end of the <label> before the </label> shows up. I'm using
@FieldLabel and everything almost works. I've eliminating error
styling in the class below so it's easier to read.
public class Validator extends ValidationDelegate {
public void writeLabelSuffix(IFormComponent component,
IMarkupWriter writer, IRequestCycle
cycle) {
if (component.isRequired())
}
The code above results in <label>blah blah</label><span class="req">
*</span>, when I'd rather have the <span> w/in the <label>. I tried
overriding writeLabelAttributes(), but that doesn't seem to allow me to
create a new tag and write it out w/in the label.
</issue>
The only way to achieve this functionality currently is to override FieldLabel and change the order of when things are written. I'll attach my custom FieldLabel to demonstrate the functionality I'm looking for.