Tags (particularly label) do not look up correct localized field name when the 
name includes indexing
-----------------------------------------------------------------------------------------------------

                 Key: STS-257
                 URL: http://mc4j.org/jira/browse/STS-257
             Project: Stripes
          Issue Type: Bug
          Components: Tag Library
    Affects Versions: Release 1.4
            Reporter: Tim Fennell
         Assigned To: Tim Fennell


I've been looking into this and I think it's actually a bug/lack of support for 
indexed property names in the way tags lookup the localized field names.  The 
"correct" way to use the label tag should be like this:
  <s:label name="choices[${num-1 }].short_text" for="text${num-1}"/>
  <s:text  name="choices[${num-1 }].short_text"  id="text${num-1}"/>

I.e. the for attribute on the label matches the 'id' attribute on the text tag. 
 But if you set it up this way then you should get the error rendering 
correctly, but the localized label won't get looked up correctly (it really 
needs to removing the indexing and look up the label with 'choices.short_text').

I'll log a bug for this.

-t

On Aug 29, 2006, at 5:57 AM, Andrea Bondi wrote:

Ok, I managed to get the label localized from StripesResources file.
But it seems that it isn't tied with the text field: even if there's an
error in that field, the label class isn't changed int class="error" and
only the field change class.

Code is:
<stripes:label name="short_text" for="choices[${num-1 }].short_text" />
<stripes:text style="width:50px;"
name="choices[${num-1 }].short_text" />

And in the rendered page, after an error:

<label for="choices[0].short_text">Risposta Corta</label>
<input value="" type="text" class="error" style="width:50px;"
name="choices[0].short_text" />

Thank you for your very useful help but, aboveall, for stripes ;)!


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

        

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to