【问题标题】:Data table with dynamic rows and columns jsf 2.2具有动态行和列的数据表 jsf 2.2
【发布时间】:2017-05-15 04:03:14
【问题描述】:

如何生成具有动态行和列的动态数据表? 行和列是基于后端值动态的。 2,3,4 列将是学期-学科组合列表的列表,用于存储所选值。

我知道这可以通过 primefaces 来实现。但是有没有办法不使用任何库,而是使用 jsf 2.2 实现这一点?

我的代码在一行中生成学期主题列表。

<table>
    <thead>
        <tr>
        <th>Enrollment</th>
            <c:forEach items="#{semesterTO.getSubjects()}" varStatus="loop"
                var="subjects" id="subjectsId">
                <th>#{subjects.Name}</th>
            </c:forEach>
        </tr>
    </thead>
    <tbody>
        <c:forEach items="#{semesterTO.getSemesters()}" var="semester"
            varStatus="status1">
            <tr>
                <td><h:outputText value="#{semester.semesterId}" /></td>
            </tr>
        </c:forEach>
        <c:forEach items="#{semesterTO.subjectSemesterList()}" var="a"
            varStatus="status2">
            <tr>
                <td><h:selectBooleanCheckbox
                        value="#{semesterTO.enrolledSubjects[a]}" /></td>
            </tr>
        </c:forEach>
    </tbody>
</table>

【问题讨论】:

    标签: jsf-2.2 dynamic-tables


    【解决方案1】:

    您可以使用数据表。按照本教程 https://www.mkyong.com/jsf2/jsf-2-datatable-example/

    或者你可以谷歌另一个,有很多:)

    【讨论】:

      猜你喜欢
      • 2015-03-24
      • 2012-01-19
      • 2017-04-04
      • 2014-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-14
      相关资源
      最近更新 更多