【问题标题】:display tag for table to create multiple links in single column表的显示标签以在单列中创建多个链接
【发布时间】:2013-11-09 06:16:44
【问题描述】:

我正在尝试使用显示标签显示表格。

<display:table name="feedList" class="table table-bordered table-hover" style="margin-bottom: 0;" requestURI="" id="mFeedList" export="true" pagesize="10">
   <display:column property="feedName" sortable="true" titleKey="Feed" />
   <display:column value="Update" href="updateFeed" media="html" paramId="feedKey" paramProperty="feedKey" titleKey="update"/>
   <display:column value="Clone" href="cloneFeed" media="html"  paramId="feedKey" paramProperty="feedKey" titleKey="clone"/>
</display:table>

但我希望在单个列中同时更新和克隆 列名- actionrow- 更新/克隆和 href 应该也一样。

我该怎么做?

【问题讨论】:

    标签: java html jsp struts


    【解决方案1】:

    &lt;display:column&gt; 中使用&lt;c:url&gt;

     <display:table id="list"   name="display_tbl"                                                                       decorator="checkboxDecorator" form="displ">
     <display:column title="action">    
            <c:url var="url" value="updateFeed">    
              <c:param name="feedKey" value="${list.feedKey}"></c:param> 
            </c:url>
           <a href=${url } title="Update"></a>  
    
          <c:url var="url1" value="cloneFeed"> 
             <c:param name="cloneFeed" value="${list.cloneFeed}"></c:param> 
          </c:url>  
           <a href=${url1}  title="Clone"></a>
    
     </display:column>
      </<display:table>
    

    【讨论】:

    • 很抱歉评论晚了,我从我的动作课上传递了一个List&lt;feed&gt; feedList。提要对象包含提要关键元素,因此它应该像&lt;a href=updateFeed?feedKey=2 title="Update" &gt;&lt;/a&gt; 一样工作,而不是像&lt;a href=updateFeed?feedKey=feedKey title="Update" &gt;&lt;/a&gt;
    • 其实它就像硬编码对吧?我正在从数据库传递提要对象。每次我检索这些数据时都会有所不同。在这种情况下,问题中的代码采用 'paramId="feedKey" paramProperty="feedKey" '。你的代码很好,但我想要我通过的列表中的 feedkey
    • 您好,您可以从列表对象中获取该属性值,请参阅我的编辑
    猜你喜欢
    • 2013-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-03
    • 1970-01-01
    • 2018-03-18
    相关资源
    最近更新 更多