Tags shouldn't output blank attributes for onXxx attrs
------------------------------------------------------

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


I'm using a JSP 2.0 tag library that wraps around the Stripes tags. I have a 
common set of attrs that each tag uses:

<%@ attribute name="name" required="true" type="java.lang.String" %>
<%@ attribute name="onblur" required="false" type="java.lang.String" %>
<%@ attribute name="onchange" required="false" type="java.lang.String" %>
<%@ attribute name="onclick" required="false" type="java.lang.String" %>
<%@ attribute name="ondblclick" required="false" type="java.lang.String" %>
<%@ attribute name="onfocus" required="false" type="java.lang.String" %>
<%@ attribute name="onkeydown" required="false" type="java.lang.String" %>
<%@ attribute name="onkeypress" required="false" type="java.lang.String" %>
<%@ attribute name="onkeyup" required="false" type="java.lang.String" %>
<%@ attribute name="onmousedown" required="false" type="java.lang.String" %>
<%@ attribute name="onmousemove" required="false" type="java.lang.String" %>
<%@ attribute name="onmouseout" required="false" type="java.lang.String" %>
<%@ attribute name="onmouseover" required="false" type="java.lang.String" %>
<%@ attribute name="onmouseup" required="false" type="java.lang.String" %>
<%@ attribute name="onselect" required="false" type="java.lang.String" %>

And then each tag is used in these wrapper tags like so:

<%@ include file="form-field-common-attrs.tag"%>
<%@ include file="form-field-header.jsp"%>
<s:text name="${name}"
        onblur="${onblur}"
        onchange="${onchange}"
        onclick="${onclick}"
        ondblclick="${ondblclick}"
        onfocus="${onfocus}"
        onkeydown="${onkeydown}"
        onkeypress="${onkeypress}"
        onkeyup="${onkeyup}"
        onmousedown="${onmousedown}"
        onmousemove="${onmousemove}"
        onmouseout="${onmouseout}"
        onmouseover="${onmouseover}"
        onmouseup="${onmouseup}"
        onselect="${onselect}"/>
<%@ include file="form-field-footer.jsp"%>

The problem is that the output generate by Stripes is:

<input onkeyup="" type="text" onclick="" onmouseout="" onkeydown="" onchange="" 
onmousedown="" onkeypress="" onselect="" ondblclick="" onfocus="" onmouseup="" 
name="inviteList" onmousemove="" onmouseover="" onblur="" />

For the on* attributes, I would like to propose that the attribute not be 
generated if the value is an empty string. Then we'd simply get:

<input onkeyup="" type="text" name="inviteList" />

-- 
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

        

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to