PrimeFaces- p浮动标签:PanelGrid
应该如何嵌入“浮动标签” - 如所述 - 进入AP:PANELGRID?
我遇到的问题是“ p:outputLabel”在“ p:inputText”的内部没有显示,但除此之外。
当前的代码:
<h:form>
<p:panelGrid id="login-grid" columns="3">
<span class="ui-float-label">
<p:inputText id="float-input-username-signin" value=""/>
<p:outputLabel for="@previous" value="Username"/>
</span>
<p:message id="login-username-msg" for="float-input-username-signin"/>
<span class="ui-float-label">
<p:password id="float-input-password-signin"/>
<p:outputLabel for="@previous" value="Password"/>
</span>
<p:message id="login-password-msg" for="float-input-password-signin"/>
<p:commandButton value="Login" id="login-button" update="login-grid" action="#{loginBean.check}" />
</p:panelGrid>
</h:form>
我已经尝试将“浮动标签”放入DIV容器的内部,但它不起作用。
非常感谢。
How is one supposed to embed a 'Floating Label' - as described here - into a p:panelGrid?
The problem i have is that 'p:outputLabel' is not shown inside of 'p:inputText' but besides it.
The current code:
<h:form>
<p:panelGrid id="login-grid" columns="3">
<span class="ui-float-label">
<p:inputText id="float-input-username-signin" value=""/>
<p:outputLabel for="@previous" value="Username"/>
</span>
<p:message id="login-username-msg" for="float-input-username-signin"/>
<span class="ui-float-label">
<p:password id="float-input-password-signin"/>
<p:outputLabel for="@previous" value="Password"/>
</span>
<p:message id="login-password-msg" for="float-input-password-signin"/>
<p:commandButton value="Login" id="login-button" update="login-grid" action="#{loginBean.check}" />
</p:panelGrid>
</h:form>
I already tried to put the 'Floating Label' inside of a div container, but it didn't work.
Thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
P:PanelGrid
(和H:PanelGrid
)仅应包含JSF组件作为直接的孩子。它将为每个人渲染一个单元。因此,使用AH:PanelGroup
Component(它将呈现span
),而不是span
标签。并使用列=“ 2”
而不是3:p:panelGrid
(andh:panelGrid
) should only contain JSF components as direct children. It will render a cell for each of them. So, instead of aspan
tag, use ah:panelGroup
component (which will render aspan
). And usecolumns="2"
instead of 3: