You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/11/10 07:35:00 UTC

[jira] [Work logged] (WW-5129) Dynamic Attributes are not working for doubleselect, optiontransferselect, inputtransferselect tags

     [ https://issues.apache.org/jira/browse/WW-5129?focusedWorklogId=679494&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-679494 ]

ASF GitHub Bot logged work on WW-5129:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Nov/21 07:34
            Start Date: 10/Nov/21 07:34
    Worklog Time Spent: 10m 
      Work Description: lukaszlenart commented on a change in pull request #495:
URL: https://github.com/apache/struts/pull/495#discussion_r746310929



##########
File path: core/src/main/resources/template/simple/dynamic-attributes.ftl
##########
@@ -21,12 +21,24 @@
 <#if (parameters.dynamicAttributes?? && parameters.dynamicAttributes?size > 0)><#rt/>
 <#assign aKeys = parameters.dynamicAttributes.keySet()><#rt/>
 <#list aKeys as aKey><#rt/>
-  <#assign keyValue = parameters.dynamicAttributes.get(aKey)/>

Review comment:
       Done, I had to use `<#function>`

##########
File path: core/src/main/resources/template/simple/prefixed-dynamic-attributes.ftl
##########
@@ -0,0 +1,36 @@
+<#--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+<#macro prefixedDynamicAttributes prefix>
+<#if (parameters.dynamicAttributes?? && parameters.dynamicAttributes?size > 0)><#rt/>
+<#assign aKeys = parameters.dynamicAttributes.keySet()><#rt/>
+<#list aKeys as aKey><#rt/>
+<#if aKey?starts_with(prefix)>
+<#assign keyValue = parameters.dynamicAttributes.get(aKey)/>
+<#if keyValue?is_string>
+    <#assign value = struts.translateVariables(keyValue)!keyValue/>
+<#else>
+    <#assign value = keyValue?string/>
+</#if>
+ ${aKey}="${value}"<#rt/>

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 679494)
    Time Spent: 1h 20m  (was: 1h 10m)

> Dynamic Attributes are not working for doubleselect, optiontransferselect, inputtransferselect tags
> ---------------------------------------------------------------------------------------------------
>
>                 Key: WW-5129
>                 URL: https://issues.apache.org/jira/browse/WW-5129
>             Project: Struts 2
>          Issue Type: Bug
>            Reporter: Lukasz Lenart
>            Assignee: Lukasz Lenart
>            Priority: Major
>             Fix For: 2.6
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> As per https://github.com/struts-community-plugins/struts2-bootstrap/pull/37



--
This message was sent by Atlassian Jira
(v8.20.1#820001)