You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2016/06/15 04:41:09 UTC

[jira] [Comment Edited] (WW-4642) Unable to retrieve s:hidden field values

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

Lukasz Lenart edited comment on WW-4642 at 6/15/16 4:41 AM:
------------------------------------------------------------

----- JSP code -----------------------------------------------------
{code:xml}
<tr>

<td>

<!---- modified and working code ------>

    <input type="hidden" id="lastUpdateTimestamp_" value="<s:property
value="lastUpdateTimestamp"/>"/>

<!---- original and non-working code with Struts 2.3.20 ------->

    <s:hidden id="lastUpdateTimestamp_" value="%{lastUpdateTimestamp}" />

</td>

</tr>
{code}

------- generated HTML code --------------------------------------------

{code:xml}

<tr>

<td>

    <input type="hidden" id="lastUpdateTimestamp_" value="6/13/16 11:02:48
AM.000"/>

<!---- original and non-working code with Struts 2.3.20 (extra tr style and td colspan) ------->

<tr style="display:none;">

    <td colspan="2">

    <input type="hidden" name="" value="6/13/16 11:02:48 AM.000" id
="lastUpdateTimestamp_"/>

   </td>

</tr>

</td>

</tr>
{code}


was (Author: nickhoang1):
----- JSP code -----------------------------------------------------

<tr>

<td>

   ---- modified and working code ------

    <input type="hidden" id="lastUpdateTimestamp_" value="<s:property
value="lastUpdateTimestamp"/>"/>



  ---- original and non-working code with Struts 2.3.20 -------

    <s:hidden id="lastUpdateTimestamp_" value="%{lastUpdateTimestamp}" />

</td>

</tr>



------- generated HTML code --------------------------------------------



<tr>

<td>

    <input type="hidden" id="lastUpdateTimestamp_" value="6/13/16 11:02:48
AM.000"/>





  ---- original and non-working code with Struts 2.3.20 (extra tr style and
td colspan) -------

<tr style="display:none;">

    <td colspan="2">

    <input type="hidden" name="" value="6/13/16 11:02:48 AM.000" id
="lastUpdateTimestamp_"/>

   </td>

</tr>



</td>

</tr>

On Thu, Jun 9, 2016 at 3:45 PM, Lukasz Lenart (JIRA) <ji...@apache.org>



> Unable to retrieve s:hidden field values
> ----------------------------------------
>
>                 Key: WW-4642
>                 URL: https://issues.apache.org/jira/browse/WW-4642
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors, Expression Language
>    Affects Versions: 2.3.20
>         Environment: windows 7, jboss eap
>            Reporter: nick
>            Assignee: Lukasz Lenart
>            Priority: Blocker
>              Labels: newbie
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> After upgrading Struts 2.3.16 to 2.3.20, my application GUI looks different. The application cannot retrieve a value stored in a hidden field using the jquery find function.
> -- The hidden fields are stored in table rows
> {code:xml}
>             <table>
>                <s:iterator value="xxx" var="yyy">
>                       <tr onclick="javascript:showRow(this);" >
>                             <td> some value </td>
>                            <s:hidden id="some hidden value" value="%{hiddenValue}" />
>                            <td> some value</td>             
>                     </tr>	
>               </s:iterator>
>         </table>
>        function showRow(row) {
>                 var $element = $(row);
>                 $element.closest("tr").find('td:first').add($element).find("input:hidden").each(function (i, elem) {
>                 // Why the code cannot access to any hidden fields here - not working in Struts 2.3.20
>                 }
>       }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)