You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Adrian Crum (JIRA)" <ji...@apache.org> on 2013/10/08 17:43:43 UTC

[jira] [Commented] (OFBIZ-5341) Adding placeholder attribute to text fields rendered via Form-Widget's text tag.

    [ https://issues.apache.org/jira/browse/OFBIZ-5341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13789306#comment-13789306 ] 

Adrian Crum commented on OFBIZ-5341:
------------------------------------

A couple of notes:

1. Please use String.isEmpty() on attribute values instead of UtilValidate.isEmpty(). The attribute will never be null, so we can invoke a String method on it without worrying about NullPointerException. I understand you just copied the existing code, but it would be nice if new code follows a better pattern.

2. Please do not refer to HTML in the form widget schema. The screen widgets are intended to be representation-agnostic, so we should avoid referring to specific representations. Maybe instead of saying "Will use to display text string as placeholder in HTML text field." it could say "Specifies a short hint that describes the expected value of an input field."

3. Please do not add methods that change the state of models. Create the FSE during construction. XML models should be thought of as immutable. Again, I understand you just copied existing code, but it would be nice if new code follows a better pattern.


> Adding placeholder attribute to text fields rendered via Form-Widget's text tag.
> --------------------------------------------------------------------------------
>
>                 Key: OFBIZ-5341
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5341
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Sumit Pandit
>            Priority: Minor
>         Attachments: OFBIZ-5341-Example.patch, OFBIZ-5341-Framework.patch
>
>
> Adding placeholder attribute to text fields rendered via Form-Widget's text tag.
> Form widget : 
> {code}
> <field name="partyId" title="${uiLabelMap.FormFieldTitle_partyId}" ><text placeholder="${uiLabelMap.FormFieldTitle_partyId}"/></field>
> {code}
> Rendered as :
> {code}
> <input type="text" placeholder="Party Id" autocomplete="off" id="partyId" size="25" name="partyId">
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)