【问题标题】:JSF Bean return HTML to DataTableJSF Bean 返回 HTML 到 DataTable
【发布时间】:2012-05-13 07:20:03
【问题描述】:

这是我的dataTable,我需要我的bean属性status是这样的:

<span class="label label-warning">Warning</span> 但它正在打印文本,而不是编译 htmldataTablecolumn 没有 espace 选项。有没有办法解决这个问题?

<h:dataTable value="#{pedidoController.orderList}" var="order"
                                 styleClass="table table-striped">
                        <h:column>
                            <f:facet name="header">#</f:facet>
                            #{order.orderNo}
                        </h:column>
                        <h:column>
                            <f:facet name="header">Cliente</f:facet>
                            #{order.client}
                        </h:column>
                        <h:column>
                            <f:facet name="header">Data</f:facet>
                            #{order.date}
                        </h:column>
                        <h:column>
                            <f:facet name="header">Status</f:facet>
                            #{order.status}
                        </h:column>
                    </h:dataTable>

【问题讨论】:

    标签: html jsf datatable


    【解决方案1】:

    使用 h:outputText 来显示数据而不是隐式的 JSF 输出。检查this related question,看看它是否能解决您的问题。

    【讨论】:

    • 谢谢,刚刚将我的 bean 行改为:&lt;h:outputText value="#{order.date}" escape="false"/&gt;
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-15
    • 1970-01-01
    • 2016-06-19
    • 2014-10-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多