[ http://issues.apache.org/jira/browse/TAPESTRY-974?page=all ]

Jesse Kuhnert resolved TAPESTRY-974.
------------------------------------

    Fix Version/s: 4.1.1
       Resolution: Fixed
         Assignee: Jesse Kuhnert

Added two new methods to IValidationDelegate as I couldn't be sure this 
wouldn't screw too many other people up. They are called beforeLabelText and 
afterLabelText.


> Modify ValidationDelegate or FieldLabel so it allows markup to be written 
> inside <label>
> ----------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-974
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-974
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.0.2
>            Reporter: Matt Raible
>         Assigned To: Jesse Kuhnert
>             Fix For: 4.1.1
>
>         Attachments: FieldLabel.java
>
>
> 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()) {
>             writer.begin("span");
>             writer.attribute("class", "req");
>             writer.printRaw(" *");
>             writer.end();
>         }
>     }
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to