You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Maja S Bratseth (JIRA)" <ji...@apache.org> on 2007/09/11 16:30:35 UTC

[jira] Created: (WW-2171) Label tag does not use key attribute to lookup value in resources when using simple theme

Label tag does not use key attribute to lookup value in resources when using simple theme
-----------------------------------------------------------------------------------------

                 Key: WW-2171
                 URL: https://issues.apache.org/struts/browse/WW-2171
             Project: Struts 2
          Issue Type: Bug
          Components: Views
    Affects Versions: 2.0.9
            Reporter: Maja S Bratseth
            Priority: Minor


When using the simple theme (setting property "struts.ui.theme" to "simple"), the struts label tag does not use the key attribute to look up label value in resources.
It does when using the css_xhtml theme.

Example jsp fragment:

    <s:label key="company.name"/>

Resource file fragment:

    company.name=Company name

Html produced by css_xhtml theme (minus some space and divs):

    <label class="label" for="xxxxx_company_name">Company name:</label>

(I am not sure where the "for" attribute comes from. I suspect that the html label tag is produced
by css_xhtml/controlheader-core.ftl).

Html produced by simple theme:

    <label id="xxxxx_company_name"/>

Html that I expected simple theme to produce:

    <label id="xxxxx_company_name">Company name</label>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2171) Label tag does not use key attribute to lookup value in resources when using simple theme

Posted by "Maxx (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42827 ] 

Maxx commented on WW-2171:
--------------------------

I also had this problem populating the "value" for a label, so after looking at the .ftl file, I found this:
You have to use
<s:label value="%{getText('company.name')}"/>

But I agree, this is not obvious regarding the other tags... :p

Note: the "label" tag is generated through the template file: <theme>/label.ftl


Example:

test.jsp:
--------------
<pre>
s:label for "firstname" with name="test.user.firstname"
<s:label id="l_firstname" for="firstname" name="test.user.firstname" />

s:label for "firstname" with name="%{getText('test.user.firstname')}"
<s:label id="l_firstname" for="firstname" name="%{getText('test.user.firstname')}" />

s:label for "firstname" with value="%{getText('test.user.firstname')}"
<s:label id="l_firstname" for="firstname" value="%{getText('test.user.firstname')}"></s:label>
<pre>
--------------

with test.user.firstname=Firstname in a global message resource

HTML output:
---------------
<pre>
s:label for "firstname" with name="test.user.firstname"
<label id="l_firstname" for="firstname"></label>

s:label for "firstname" with name="%{getText('test.user.firstname')}"
<label id="l_firstname" for="firstname"></label>

s:label for "firstname" with value="%{getText('test.user.firstname')}"
<label id="l_firstname" for="firstname">Firstname</label>
</pre>
---------------

> Label tag does not use key attribute to lookup value in resources when using simple theme
> -----------------------------------------------------------------------------------------
>
>                 Key: WW-2171
>                 URL: https://issues.apache.org/struts/browse/WW-2171
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.0.9
>            Reporter: Maja S Bratseth
>            Priority: Minor
>             Fix For: 2.1.1
>
>         Attachments: label-patch.txt
>
>
> When using the simple theme (setting property "struts.ui.theme" to "simple"), the struts label tag does not use the key attribute to look up label value in resources.
> It does when using the css_xhtml theme.
> Example jsp fragment:
>     <s:label key="company.name"/>
> Resource file fragment:
>     company.name=Company name
> Html produced by css_xhtml theme (minus some space and divs):
>     <label class="label" for="xxxxx_company_name">Company name:</label>
> (I am not sure where the "for" attribute comes from. I suspect that the html label tag is produced
> by css_xhtml/controlheader-core.ftl).
> Html produced by simple theme:
>     <label id="xxxxx_company_name"/>
> Html that I expected simple theme to produce:
>     <label id="xxxxx_company_name">Company name</label>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2171) Label tag does not use key attribute to lookup value in resources when using simple theme

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-2171:
-----------------------------

    Fix Version/s:     (was: 2.0.11)
                   2.0.12

> Label tag does not use key attribute to lookup value in resources when using simple theme
> -----------------------------------------------------------------------------------------
>
>                 Key: WW-2171
>                 URL: https://issues.apache.org/struts/browse/WW-2171
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: 2.0.9
>            Reporter: Maja S Bratseth
>            Priority: Minor
>             Fix For: 2.0.12
>
>         Attachments: label-patch.txt
>
>
> When using the simple theme (setting property "struts.ui.theme" to "simple"), the struts label tag does not use the key attribute to look up label value in resources.
> It does when using the css_xhtml theme.
> Example jsp fragment:
>     <s:label key="company.name"/>
> Resource file fragment:
>     company.name=Company name
> Html produced by css_xhtml theme (minus some space and divs):
>     <label class="label" for="xxxxx_company_name">Company name:</label>
> (I am not sure where the "for" attribute comes from. I suspect that the html label tag is produced
> by css_xhtml/controlheader-core.ftl).
> Html produced by simple theme:
>     <label id="xxxxx_company_name"/>
> Html that I expected simple theme to produce:
>     <label id="xxxxx_company_name">Company name</label>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2171) Label tag does not use key attribute to lookup value in resources when using simple theme

Posted by "Maja S Bratseth (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maja S Bratseth updated WW-2171:
--------------------------------

    Attachment: label-patch.txt

Patch

> Label tag does not use key attribute to lookup value in resources when using simple theme
> -----------------------------------------------------------------------------------------
>
>                 Key: WW-2171
>                 URL: https://issues.apache.org/struts/browse/WW-2171
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: 2.0.9
>            Reporter: Maja S Bratseth
>            Priority: Minor
>         Attachments: label-patch.txt
>
>
> When using the simple theme (setting property "struts.ui.theme" to "simple"), the struts label tag does not use the key attribute to look up label value in resources.
> It does when using the css_xhtml theme.
> Example jsp fragment:
>     <s:label key="company.name"/>
> Resource file fragment:
>     company.name=Company name
> Html produced by css_xhtml theme (minus some space and divs):
>     <label class="label" for="xxxxx_company_name">Company name:</label>
> (I am not sure where the "for" attribute comes from. I suspect that the html label tag is produced
> by css_xhtml/controlheader-core.ftl).
> Html produced by simple theme:
>     <label id="xxxxx_company_name"/>
> Html that I expected simple theme to produce:
>     <label id="xxxxx_company_name">Company name</label>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WW-2171) Label tag does not use key attribute to lookup value in resources when using simple theme

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Husted resolved WW-2171.
----------------------------

    Resolution: Fixed

Completed: At revision: 614842  -- Thanks Maja!


> Label tag does not use key attribute to lookup value in resources when using simple theme
> -----------------------------------------------------------------------------------------
>
>                 Key: WW-2171
>                 URL: https://issues.apache.org/struts/browse/WW-2171
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.0.9
>            Reporter: Maja S Bratseth
>            Assignee: Ted Husted
>            Priority: Minor
>             Fix For: 2.1.1
>
>         Attachments: label-patch.txt
>
>
> When using the simple theme (setting property "struts.ui.theme" to "simple"), the struts label tag does not use the key attribute to look up label value in resources.
> It does when using the css_xhtml theme.
> Example jsp fragment:
>     <s:label key="company.name"/>
> Resource file fragment:
>     company.name=Company name
> Html produced by css_xhtml theme (minus some space and divs):
>     <label class="label" for="xxxxx_company_name">Company name:</label>
> (I am not sure where the "for" attribute comes from. I suspect that the html label tag is produced
> by css_xhtml/controlheader-core.ftl).
> Html produced by simple theme:
>     <label id="xxxxx_company_name"/>
> Html that I expected simple theme to produce:
>     <label id="xxxxx_company_name">Company name</label>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WW-2171) Label tag does not use key attribute to lookup value in resources when using simple theme

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Husted reassigned WW-2171:
------------------------------

    Assignee: Ted Husted

> Label tag does not use key attribute to lookup value in resources when using simple theme
> -----------------------------------------------------------------------------------------
>
>                 Key: WW-2171
>                 URL: https://issues.apache.org/struts/browse/WW-2171
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.0.9
>            Reporter: Maja S Bratseth
>            Assignee: Ted Husted
>            Priority: Minor
>             Fix For: 2.1.1
>
>         Attachments: label-patch.txt
>
>
> When using the simple theme (setting property "struts.ui.theme" to "simple"), the struts label tag does not use the key attribute to look up label value in resources.
> It does when using the css_xhtml theme.
> Example jsp fragment:
>     <s:label key="company.name"/>
> Resource file fragment:
>     company.name=Company name
> Html produced by css_xhtml theme (minus some space and divs):
>     <label class="label" for="xxxxx_company_name">Company name:</label>
> (I am not sure where the "for" attribute comes from. I suspect that the html label tag is produced
> by css_xhtml/controlheader-core.ftl).
> Html produced by simple theme:
>     <label id="xxxxx_company_name"/>
> Html that I expected simple theme to produce:
>     <label id="xxxxx_company_name">Company name</label>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2171) Label tag does not use key attribute to lookup value in resources when using simple theme

Posted by "Maja S Bratseth (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maja S Bratseth updated WW-2171:
--------------------------------

    Flags: [Patch]

Attached patch

> Label tag does not use key attribute to lookup value in resources when using simple theme
> -----------------------------------------------------------------------------------------
>
>                 Key: WW-2171
>                 URL: https://issues.apache.org/struts/browse/WW-2171
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: 2.0.9
>            Reporter: Maja S Bratseth
>            Priority: Minor
>         Attachments: label-patch.txt
>
>
> When using the simple theme (setting property "struts.ui.theme" to "simple"), the struts label tag does not use the key attribute to look up label value in resources.
> It does when using the css_xhtml theme.
> Example jsp fragment:
>     <s:label key="company.name"/>
> Resource file fragment:
>     company.name=Company name
> Html produced by css_xhtml theme (minus some space and divs):
>     <label class="label" for="xxxxx_company_name">Company name:</label>
> (I am not sure where the "for" attribute comes from. I suspect that the html label tag is produced
> by css_xhtml/controlheader-core.ftl).
> Html produced by simple theme:
>     <label id="xxxxx_company_name"/>
> Html that I expected simple theme to produce:
>     <label id="xxxxx_company_name">Company name</label>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2171) Label tag does not use key attribute to lookup value in resources when using simple theme

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-2171:
-----------------------------

    Fix Version/s: 2.0.11

> Label tag does not use key attribute to lookup value in resources when using simple theme
> -----------------------------------------------------------------------------------------
>
>                 Key: WW-2171
>                 URL: https://issues.apache.org/struts/browse/WW-2171
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: 2.0.9
>            Reporter: Maja S Bratseth
>            Priority: Minor
>             Fix For: 2.0.11
>
>         Attachments: label-patch.txt
>
>
> When using the simple theme (setting property "struts.ui.theme" to "simple"), the struts label tag does not use the key attribute to look up label value in resources.
> It does when using the css_xhtml theme.
> Example jsp fragment:
>     <s:label key="company.name"/>
> Resource file fragment:
>     company.name=Company name
> Html produced by css_xhtml theme (minus some space and divs):
>     <label class="label" for="xxxxx_company_name">Company name:</label>
> (I am not sure where the "for" attribute comes from. I suspect that the html label tag is produced
> by css_xhtml/controlheader-core.ftl).
> Html produced by simple theme:
>     <label id="xxxxx_company_name"/>
> Html that I expected simple theme to produce:
>     <label id="xxxxx_company_name">Company name</label>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2171) Label tag does not use key attribute to lookup value in resources when using simple theme

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43088#action_43088 ] 

Ted Husted commented on WW-2171:
--------------------------------

I think this commit missed today's build, Maja, but if you can grab the JAR tomorrow, and try it in your application, that would be great!

 * http://people.apache.org/builds/struts/nightlies/2.x/



> Label tag does not use key attribute to lookup value in resources when using simple theme
> -----------------------------------------------------------------------------------------
>
>                 Key: WW-2171
>                 URL: https://issues.apache.org/struts/browse/WW-2171
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions: 2.0.9
>            Reporter: Maja S Bratseth
>            Assignee: Ted Husted
>            Priority: Minor
>             Fix For: 2.1.1
>
>         Attachments: label-patch.txt
>
>
> When using the simple theme (setting property "struts.ui.theme" to "simple"), the struts label tag does not use the key attribute to look up label value in resources.
> It does when using the css_xhtml theme.
> Example jsp fragment:
>     <s:label key="company.name"/>
> Resource file fragment:
>     company.name=Company name
> Html produced by css_xhtml theme (minus some space and divs):
>     <label class="label" for="xxxxx_company_name">Company name:</label>
> (I am not sure where the "for" attribute comes from. I suspect that the html label tag is produced
> by css_xhtml/controlheader-core.ftl).
> Html produced by simple theme:
>     <label id="xxxxx_company_name"/>
> Html that I expected simple theme to produce:
>     <label id="xxxxx_company_name">Company name</label>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.