struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Get single value from a row with displaytag and struts 2
Date Mon, 15 Jun 2015 22:27:28 GMT
It sounds to me like you're submitting the row object rather than the ID of the object for
which you want to operation upon.

The following example should work:

<display:table name="notifications" uid="tableListUid">
    <s:form action="acknowledgeDocumentNotification">
      <s:hidden name="documentId" value="%{#tableListUid.documentId}"/>
      <s:submit key="button.submit"/>

The above code gets the document id from the uid specified and uses it as a hidden value in
the form submission. There are other neat way to avoid having a form per row, but this is
simple enough.

Your acknowledgeDocumentNotification action should then only receive the documentId parameter
with the row's document id as the only input value.


-----Original Message-----
From: Christoph Nenning [] 
Sent: Monday, June 08, 2015 5:50 AM
To: Struts Users Mailing List
Subject: Re: Get single value from a row with displaytag and struts 2

> From: Álex Basoa <>
> To:,
> Date: 03.06.2015 09:33
> Subject: Get single value from a row with displaytag and struts 2
> i have a table wich works perfect made with struts 2 and displaytag
>         <display:table name="session.listaNotificaciones" 
>                    requestURI="navegarNuevoEnvio.action" 
>                    summary="Listado de Notificaciones" cellspacing="0"
> cellpadding="0"
>                    uid="listaContatosTable">
>         <display:column title="Estado" sortProperty="estado_Nue"
>                                 sortable="false"
> headerClass="sortable" defaultorder="descending"
>                                 style="width:12% ;color:red">
>                     <s:property
> value="%
> {@registradores.utiles.enumerados.EstadoTramite@convertirTexto
> (#attr.listaContatosTable.estado_Nue)}"
> />
>                 </display:column>
>         <display:column title="Archivo"  headerClass="sortable"
> sortable="false" defaultorder="descending"
>                         style="width:12% ;color:black">
>             <s:hidden key="estado"
> value="%{#attr.listaContatosTable.estado_Nue}" />
>             <s:submit id="botonNotificacion" value="Notificación"
>                       cssClass="boton"
> onclick="enviarA('descargarDocumentoNotificacionAcuse.action')"/>
>         </display:column>
> The problem is that i have declared in the action
>     private String estado;
> And i get all values from estado_Nue, but i only need the value wich i
> "clicked"
> Thx for all your help


not sure if i understand what the problem is. You get all items of a list posted when you
submit your form? How does the html look like? What form elements are generated by display?


This Email was scanned by Sophos Anti Virus

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message