You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Michael Hum (Jira)" <ji...@apache.org> on 2023/10/18 16:13:00 UTC

[jira] (WW-5357) Struts anchor tag doesn't support "disabled"

    [ https://issues.apache.org/jira/browse/WW-5357 ]


    Michael Hum deleted comment on WW-5357:
    ---------------------------------

was (Author: mikehum1):
With all that being said, I don't believe disabled is actually a spec-valid attribute for <a> tags, however it seems browsers do support it. So not really sure what to make of things!

> Struts anchor tag doesn't support "disabled"
> --------------------------------------------
>
>                 Key: WW-5357
>                 URL: https://issues.apache.org/jira/browse/WW-5357
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Tags
>    Affects Versions: 2.5.26
>            Reporter: Michael Hum
>            Priority: Major
>
> Hello there,
> When generating an anchor tag with the "disabled" attribute and the simple theme, struts does not seem to render it properly:
> {code}
> <%@taglib prefix="s" uri="/struts-tags" %>
> ...
> <s:a action="myAction" cssClass="btn btn-default" disabled="true">
>     <s:param name="myParam" value="#bean.Value"/>
>     <s:text name="my.properties.key"/>
> </s:a>
> {code}
> The generated link does not contain expected disabled="disabled".
> The value is described in the TLD and is documented on the site https://struts.apache.org/tag-developers/a-tag :
> {code:xml}
>     <attribute>
>       <description><![CDATA[Set the html disabled attribute on rendered html element]]></description>
>       <name>disabled</name>
>       <required>false</required>
>       <rtexprvalue>false</rtexprvalue>
>     </attribute>
> {code}
> It looks like it's missing from the .ftl file? I added it manually as a work-around with an overridden template, but perhaps I missed something. We are admittedly on an old version of struts but I didn't see any differences in the current version of the git repo.
> {code}
> <#if parameters.disabled!false>
>  disabled="disabled"<#rt/>
> </#if>
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)