You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Ben Sommerville (JIRA)" <de...@tapestry.apache.org> on 2007/05/23 02:05:16 UTC

[jira] Commented: (TAPESTRY-1490) Textfield component not generating label

    [ https://issues.apache.org/jira/browse/TAPESTRY-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498062 ] 

Ben Sommerville commented on TAPESTRY-1490:
-------------------------------------------

The TextField component does not actually generate the label, you need to include a Label component for that.
e.g.

<t:form>
     <t:label for="id"/>
    <t:textfield t:id="id" label="Id" disabled="true" value="id"/>
</t:form>

T5 is also smart enough for this to work

<t:form>
     <t:label for="id"/>
    <t:textfield t:id="id" disabled="true" />
</t:form>

You can leave out the value parameter because it is the same as the t:id.
And you can leave out the label because tapestry will generate a label by capitalizing the t:id.




> Textfield component not generating label
> ----------------------------------------
>
>                 Key: TAPESTRY-1490
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1490
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Core Components
>    Affects Versions: 5.0.3
>         Environment: Tapestry 5.0.3, Project created from Maven Archetype, Developing under Eclipse with Jetty
>            Reporter: Brice Fisher
>            Priority: Minor
>
> The TextField component is not generating a label regardless of whether the "label" parameter is set or not.
> Java:
> public class Test
> {
>     private String id = "foo";
>     public String getId() {
>         return id;
>     }
>     public void setId(String id) {
>         this.id = id;
>     }    
> }
> HTML:
> <t:form>
>     <t:textfield label="Id" disabled="true" value="id"/>
> </t:form>
> Result:
> <form action="/myapp/test.form;jsessionid=1r33ppf82unco" id="form" method="post" name="form">
>     <div class="t-invisible">
>         <input name="t:formdata" type="hidden" value="H4sIAAAAAAAAAJXOsa4BURAG4CG5hVBJ7hsgqqNRuZVGJSJZapk9Zte5OWd3cs5gvYwnEC+h0HkHD6BVKaxI9Nr558//HW7ws+1CJ/epogIdW1Juh8yKMaWgZhRkIFRIYsgug4fB6xMZ9YqUIJex3ymde7ImVjEGUsO4vKGW0avRikjWPNRi8qw9P9Wvv+dHFSpjaCzIkqNMJuhIoDn+xw32LGZpLxJvsvSvYIHaZ/or5OhL5NTnmkKI1rEzIZTUN/h0XPaT+/5SBSj4CXfJr1UqAQAA">
>     </div>
>     <input disabled="disabled" id="textfield" name="textfield" type="text" value="foo">
> <img alt="[Error]" class="t-error-icon t-invisible" id="textfield:icon" src="/myapp/assets/tapestry/field-error-marker.png">
> </form>

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org