WW-5357 Adds support for disabled attribute to anchor tag

This commit is contained in:
Lukasz Lenart
2024-01-19 07:35:09 +01:00
parent 3a1a89a547
commit 3ec313aa0b
3 changed files with 21 additions and 0 deletions
@@ -25,6 +25,9 @@
<#if parameters.href??>
href="${parameters.href?no_esc}"<#rt/>
</#if>
<#if parameters.disabled!false>
disabled="disabled"<#rt/>
</#if>
<#if parameters.tabindex??>
tabindex="${parameters.tabindex}"<#rt/>
</#if>
@@ -276,6 +276,23 @@ public class AnchorTest extends AbstractUITagTest {
verifyResource("href-5.txt");
}
public void testSimpleDisabled() throws Exception {
createAction();
AnchorTag tag = createTag();
tag.setHref("a");
tag.setDisabled("true");
StrutsBodyContent body = new StrutsBodyContent(null);
body.print("should have disabled attribute");
tag.setBodyContent(body);
tag.doStartTag();
tag.doEndTag();
verifyResource("href-6.txt");
}
public void testInjectEscapeHtmlBodyFlag() throws Exception {
// given
initDispatcherWithConfigs("struts-default.xml, struts-escape-body.xml");
@@ -0,0 +1 @@
<a id="mylink" href="a" disabled="disabled">should have disabled attribute</a>