【问题标题】:Element td rendered by component not explicitly closed组件渲染的元素 td 未显式关闭
【发布时间】:2014-03-05 14:34:55
【问题描述】:

我有下面的代码,有时我的页面没有正确呈现:

 <div id="logout" style="text-align:right;">
        <h:panelGrid columns="2">
            <h3>
                <h:outputText value="Hello #{myBean.usr.name} #{myBean.usr.surname}" style="color:black;"/>
            </h3>
            <p:commandLink action="#{myBean.quit}" immediate="true">
                <h:outputText value="Quit"/>
            </p:commandLink>
        </h:panelGrid>
</div>

我有一个警告:

WARNING: HTML nesting warning on closing h3: element td rendered by component : [...] not explicitly closed

我知道这只是一个警告,但我想解决问题以确保这不是导致显示不良的原因。

【问题讨论】:

  • 我找到了一个解决方案,删除panelGridcolumns 属性并删除h3 标签。

标签: html css jsf primefaces


【解决方案1】:

您可以删除 &lt;h3&gt; 标记并使用 CSS 类设置 &lt;h:outputText&gt; 的样式。或者尝试将部分包含在&lt;h:panelGroup&gt;中。

<h:panelGrid columns="2">
    <h:panelGroup>
        <h3>
            <h:outputText value="Hello #{myBean.usr.name} #{myBean.usr.surname}" />
        </h3>
    </h:panelGroup>

    <p:commandLink action="#{myBean.quit}" immediate="true">
        <h:outputText value="Quit"/>
    </p:commandLink>

</h:panelGrid>

Laying Out Components with the h:panelGrid and h:panelGroup Tags

【讨论】:

  • 试过但没有改变任何东西!谢谢。
猜你喜欢
  • 2019-08-30
  • 2022-01-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-23
  • 2017-03-12
  • 1970-01-01
  • 2020-06-18
相关资源
最近更新 更多