2016-01-20 61 views
0

渲染我有一个PF TabView的内selectOne菜单:Primefaces 5 selectOneMenu用于正确内TabView的

<ui:composition template="./../../../ClientSimple.xhtml"> 

     <ui:define name="top"> 
      <h2>Public Cloud Menu</h2> 
     </ui:define> 
     <ui:define name="content"> 
      <h:form id="treelist"> 
       <p:tabView> 
        <p:tab id="dattab" title="Data"> 
         <p:selectOneMenu id="datmen" value="#{clientDataBean.marketid}"> 
          <f:selectItems value="#{marketbean.allMarksNorm}" var="mark" 
              itemLabel="#{mark.marketname}" 
              itemValue="#{mark.marketid}"/> 
         </p:selectOneMenu> 
        </p:tab> 
       </p:tabView>     
      </h:form> 
     </ui:define> 
    </ui:composition> 

的观点完全与出现在页面的顶部,其余的菜单的顶部扭曲菜单出现在底部。

如果我更改为h:selectOneMenu一切都呈现完美,但我更愿意使用PF组件。模板页面:

<h:head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 
    <h:outputStylesheet name="./css/default.css"/> 
    <h:outputStylesheet name="./css/cssLayout.css"/> 
    <h:outputStylesheet name="./css/paceradar.css"/> 
    <h:outputStylesheet name="/css/paceradar.css"/> 
    <h:outputScript name="/js/pace.js"/> 

    <h:form> 
     <title>Client Module</title> 
     <p:panel style="text-align: right;"> 
      <p:commandLink value="#{secBean.username}" style="margin-left: 10px;" 
          action="#{secBean.showProfiles}" 
          rendered="#{secBean.showUser}" 
          /> 
      <p:spacer width="40"/> 
      <p:commandLink id="loginbutt" value="Login" action="#{secBean.loginForm}" 
          process="loginbutt" 
          rendered="#{secBean.login}"/> 
      <p:commandLink id="logout" value="Logout" action="#{secBean.logout}" 
          process="logout" 
          rendered="#{secBean.showUser}"/> 
     </p:panel> 
     <h:link outcome="/EnliteWelcome.xhtml"> 
      <p:graphicImage value="/resources/images/logo.png" /> 
     </h:link> 
    </h:form> 
</h:head> 

<h:body> 
    <div id="top"> 
     <ui:insert name="top">Top</ui:insert> 
    </div> 
    <div id="content"> 
     <ui:insert name="content">Content</ui:insert> 
    </div> 
</h:body> 
+0

不能再现目前的最新版本PF5您的问题(我只是copypasted你的XHTML代码插入一个templateless测试文件中的一切设置为默认值,最新版本完全空白的项目)。因此,迄今为止提供的信息中不可见。发布MCVE。如果有必要,请阅读http://stackoverflow.com/tags/jsf/info,如果你不知道如何。 – BalusC

+0

我更新了希望MCVE风格的代码 –

+0

您是否暗示您也无法在完全空白项目中的无模板测试文件中自行复制它,并且所有内容都设置为默认值和最新版本?因此,模板中至少有一件事导致了它? – BalusC

回答

0

对于一些奇怪的原因,在模板页面移除面板标签解决了这个问题。从检查页面时我找不到任何css冲突。我首先想到的是该小组可能会溢出并搞乱边缘。我修改了“溢出”,将其设置为隐藏并尝试了不同的设置,但这并未解决任何问题。问题解决了,但我不明白为什么这个小组是罪魁祸首。

<h:form> 
    <title>Client Module</title> 

     <p:commandLink value="#{secBean.username}" style="margin-left: 10px;" 
         action="#{secBean.showProfiles}" 
         rendered="#{secBean.showUser}" 
         /> 
     <p:spacer width="40"/> 
     <p:commandLink id="loginbutt" value="Login" action="#{secBean.loginForm}" 
         process="loginbutt" 
         rendered="#{secBean.login}"/> 
     <p:commandLink id="logout" value="Logout" action="#{secBean.logout}" 
         process="logout" 
         rendered="#{secBean.showUser}"/> 

    <h:link outcome="/EnliteWelcome.xhtml"> 
     <p:graphicImage value="/resources/images/logo.png" /> 
    </h:link> 
</h:form> 
相关问题