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

Javier edited comment on WW-5247 at 10/20/22 1:07 PM:
------------------------------------------------------

Yes, the jquery-plugin is causing the problem but
this works with 2.5.20 but does NOT work with 2.5.29, 2.5.30 and they all use 
the same jquery plugin version. Hence it is because of the changes made in 
2.5.29 and 2.5.30.
To test I changed the code to this ( using regular html form, hidden field ):

<form id="getRole${currentObj.roleid}"  action="getRoleAuthRolesPerms.action" > 
   
                        <input type="hidden" name="authorityRole.roleid" 
value="${currentObj.roleid}" />

                        <sj:submit formId="getRole%\{#attr.currentObj.roleid}"  
targets="roleAjaxDiv" effect="highlight" indicator="roleIndicator" title="View 
Role" type="image" src="../img/view.gif"  />
                        
                    </s:form>

And THIS WORKS 100% the way it should, on  2.5.29 and 2.5.30. So if it works 
when removing the Struts2 form and Struts2 hidden field then it is struts2 
causing the problem. I believe it is because of the changes made in 2.5.29 and 
2.5.30.

 


was (Author: ajant):
Yes, the jquery-plugin is causing the problem but
this works with 2.5.20 but does NOT work with 2.5.29, 2.5.30 and they all use 
the same jquery plugin version. Hence it is because of the changes made in 
2.5.29 and 2.5.30.
To test I changed the code to this ( using regular html form, hidden field ):

<form id="getRole${currentObj.roleid}"  action="getRoleAuthRolesPerms.action" > 
   
                        <input type="hidden" name="authorityRole.roleid" 
value="${currentObj.roleid}" />

                        <sj:submit formId="getRole%\{#attr.currentObj.roleid}"  
targets="roleAjaxDiv" effect="highlight" indicator="roleIndicator" title="View 
Role" type="image" src="../img/view.gif"  />
                        
                    </s:form>

And THIS WORKS 100% the way it should, on  2.5.29 and 2.5.30. Hence, I believe 
it is because of the changes made in 2.5.29 and 2.5.30.



 

> Related to: [WW-5117] - %{id} evaluates different for data-* and value 
> attribute
> --------------------------------------------------------------------------------
>
>                 Key: WW-5247
>                 URL: https://issues.apache.org/jira/browse/WW-5247
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.5.30
>            Reporter: Javier
>            Priority: Major
>             Fix For: 6.1.0
>
>
> I upgraded from 2.5.20 to 2.5.30 and the following stopped working:
> <display:table class="table table-sm table-bordered highliterows" 
> id="currentObj" name="${roleEntry.value}" >
>                 
>                 <display:column class="centerCol" title="Role Name" 
> property="name"    />
>                 <display:column class="centerCol " title="View" 
> style="width:1%">
>                     <s:form id="getRole%\{#attr.currentObj.roleid}" 
> theme="simple" action="getRoleAuthRolesPerms" >    
>                         <s:hidden name="authorityRole.roleid" 
> value="%\{#attr.currentObj.roleid}" />
>                         <sj:submit targets="roleAjaxDiv" effect="highlight" 
> indicator="roleIndicator"  cssClass="tooltipBorderless"  title="View Role" 
> type="image" src="../img/view.gif"  />
>                         
>                     </s:form>
>                 </display:column>
> </display:table>
> Generates:
> <form id="getRole159" name="getRole159" 
> action="/apps/epar/getRoleAuthRolesPerms.action" method="post" 
> class="formstyle">    
>                         <input type="hidden" name="authorityRole.roleid" 
> value="159" id="getRole159_authorityRole_roleid">
>                         <input type="image" src="../img/view.gif" 
> id="submit_213350257" value="Submit" class="tooltipBorderless" title="View 
> Role">
> <script type="text/javascript">
> jQuery(document).ready(function () { 
>     var options_submit_213350257 = {};
>     options_submit_213350257.jqueryaction = "button";
>     options_submit_213350257.id = "submit_213350257";
>     options_submit_213350257.targets = "roleAjaxDiv";
>     options_submit_213350257.href = "#";
>     options_submit_213350257.formids = "getRole%\{#attr.currentObj.roleid}";
>     options_submit_213350257.indicatorid = "roleIndicator";
>     options_submit_213350257.effect = "highlight";
>     options_submit_213350257.effectoptions = {};
> jQuery.struts2_jquery.bind(jQuery('#submit_213350257'),options_submit_213350257);
>  });  
> </script>
>  </form>
> The JS that it generates does NOT translate: 
> options_submit_213350257.formids = "getRole%\{#attr.currentObj.roleid}";
> This works with 2.5.20 but does NOT work with 2.5.29, 2.5.30. 
> Works with 6.0.3, but not ready to upgrade to it, seems very unstable.
> I believe this is related to: 
>  * [WW-5117] - %\{id} evaluates different for data-* and value attribute
>  
>  
>                 



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

Reply via email to