【问题标题】:how to generate an outputlink from database?如何从数据库生成输出链接?
【发布时间】:2014-06-25 01:21:39
【问题描述】:

我从带有 icefaces 的 jsf 开始,我需要这样做 这是我的mysql表

我想为每一行生成一个输出链接,这就是我所做的

【问题讨论】:

    标签: hibernate jsf jsf-2 icefaces


    【解决方案1】:

    根据@BalusC 先生的answer,您可以通过以下方式实现:

    <h:dataTable value="#{bean.someList}" var="v" binding="#{someList}" rules="all">
         <h:column>
              <f:facet name="header">titulos</f:facet> #{v.field1}
         </h:column>
         <h:column>
              <f:facet name="header">link</f:facet> #{v.field2}
         </h:column>
         <h:column>
              <h:outputLink>www.newentity#{someList.rowIndex + 1}.com</h:outputLink>
         </h:column>
     </h:dataTable>
    

    如果生成的当前网站编号不依赖于行表,而是依赖于当前的某个实体值,则将最后一列内容替换为:

             <h:outputLink>www.newentity#{v.someIdentifiantField}.com</h:outputLink>
    

    【讨论】:

      【解决方案2】:

      您可以根据您的用例使用&lt;h:outputLink &gt;&lt;h:commandLink &gt;&lt;h:link&gt; 组件之一。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-08-26
        • 1970-01-01
        • 1970-01-01
        • 2014-03-29
        • 1970-01-01
        • 2012-03-28
        相关资源
        最近更新 更多