首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 ><h:小组成员layout=“块”>不向HTML呈现任何内容

<h:小组成员layout=“块”>不向HTML呈现任何内容
EN

Stack Overflow用户
提问于 2016-11-04 02:28:37
回答 1查看 7.4K关注 0票数 1

我试图在<h:panelGroup layout="block">中显示一些元素。这些元素正在屏幕上显示,但是HTML根本没有呈现。

这是我的JSF代码:

代码语言:javascript
复制
<h:form id="editProfile">
    <div class="password-container">
        <h:outputText class="edit-header" value="Change Password &#8594;"></h:outputText>
        <br />
        <br />
        <!-- this div is not being displayed,
             THE ELEMENTS INSIDE THE PANELGROUP ARE BEING DISPLAYED -->
        <h:panelGroup layout="block">
            <h:inputText a:placeholder="Present Password" id="password" 
                value="#{editProfile.password}"
                class="cff-inputText"></h:inputText>
            <br />
            <h:inputText a:placeholder="New Password" id="change-password"
                class="cff-inputText"></h:inputText>
            <br />
            <button id="cancel-password" class="cff-button">Cancel</button>
            <button id="ok-password" class="cff-button">OK</button>
        </h:panelGroup>
    </div>
</h:form>

这是生成的HTML输出:

代码语言:javascript
复制
 //This is not the panelGroup div
 <div class="password-container"><span class="edit-header">Change Password →</span>
                       <br /><br />

   //These are the elements inside the div! but the panelGroup Div is not being rendered
   <input id="editProfile:password" type="text" name="editProfile:password" class="cff-inputText" placeholder="Present Password" />
       <br /><input id="editProfile:change-password" type="text" name="editProfile:change-password" class="cff-inputText" placeholder="New Password" />
       <br />
       <button id="cancel-password" class="cff-button">Cancel</button>
       <button id="ok-password" class="cff-button">OK</button>

 </div><input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:0" value="6732837357534288958:1301728140408675513" autocomplete="off" />

有人能告诉我哪里出了问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-11-04 15:28:42

您需要添加idstylestyleClass属性,以确保将呈现<div>。基本上,如果需要的话,它就是添加一些

The 文档

用于只能嵌套一个UIComponent子级的情况,例如在面的情况下。

在这种情况下,您可能应该使用普通的<div>而不是h:panelGroup

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40414372

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档