Menu

display:column with some parameters

Help
msi_
2005-07-12
2012-10-08
  • msi_

    msi_ - 2005-07-12

    Hello and sorry for my english. I use displaytags libraries to show datas in a jsp page with Struts. Id like a column where the user may edit/delete.

    <display:table name="sessionScope.tablatemporadas"> <display:column property="temporada"/> <display:column property="year""/> <display:column title="Edit" href="/modificatemporada.jsp" paramId="id" paramProperty="temporada">edit</display:column></display:table>

    If i coded this, modificatemporada.jsp recover the parameter right but... How can i send more parameters?

    Id like use action instead of href="...." and i have seen <display:column havent action attribute. How can i use <html:link action="..." with some parameters of display:column?

    <display:table name="sessionScope.tablatemporadas"> <display:column property="temporada"/> <display:column property="year""/> <display:column title="Edit"> <html:link action="editGo.do" ...??...>edit</html:link></display:column></display:table>

    Any help will be grateful.

     
    • Christopher K Koenigsberg

      How about, for your "paramProperty" with the embedded "bean:write", you just do jstl or a jsp expression instead of the "bean:write".

      Old fashioned jsp expression would be
      "<%=session.getTable.getTemporada()%>".

      Otherwise the problem is, I think, all taglib tags are evaluated in a single pass over the page, so it (the jsp compiler) can't recursively go in and expand the "bean:write" when it's in the middle of expanding the attributes for the "html:link".

      But the jsp compiler CAN handle jsp expressions and/or jstl, for the attribute values of the outer tag it is currently expanding (the "html:link").
      .

       
    • Christopher K Koenigsberg

      There seem to be various different hack ways to accomplish it, but I'm really not sure what is the "best", cleanest, most readable, maintainable way!

       
    • msi_

      msi_ - 2005-07-14

      Well, i hope explain clearly. I use Struts, and in ArraList i recover information. I can write:

      <logic:present name="tablatemporadas">
      <logic:iterate id="temp" name="tablatemporadas">
      <bean:write name="temp" property="temporada"/>
      <html:link action="modificartemporadaGo.do" paramId="id2" paramName="temp" paramProperty="temporada">edit</html:link>
      <br/>
      </logic:iterate>
      </logic:present>

      And the result is correct (but without table). Each edit link have a correct param.

      TEMPORADA...... EDITAR
      2000-2001...........edit
      2001-2002...........edit

      Id like use displaytags for paging and sorting but this code dont work. For example:

      <display:table id="tabla" name="sessionScope.tablatemporadas"/>

      <display:column titleKey="campo.temporada" property="temporada"/>

      <display:column title="OOOO">
      <html:link action="EditTemp.do" paramId="id2" paramName="temp" paramProperty="temporada">edit</html:link>
      </display:column>

      </display:table>

      The information of links havent correct parameters. I can recover and show the information of temporadas:

      <bean:write name="tabla" property="temporada"/>

      The perfect of me is:

      <html:link action="EditTemp.do" paramId="id2" paramName="temp" paramProperty='<bean:write name="tabla" property="temporada"/>'> edit </html:link>

      But this is impossible. Any idea?

       

Log in to post a comment.

MongoDB Logo MongoDB