首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JSF Primefaces和Bootsfaces

JSF Primefaces和Bootsfaces
EN

Stack Overflow用户
提问于 2015-09-16 12:26:58
回答 1查看 5.1K关注 0票数 0

我有个问题。

我正在制作一个布局为PrimeFaces的网站,当我点击左边的任何菜单项时,它会加载一个页面在中心,但是当我使用BootsFaces主题时(<bnu: panel ....> </bnu: panel>,页面加载在中心但它不是另一个加载),当我不使用主题时,一切都很好,但是面板显示在没有样式的纯文本外观=“成功”例如。

代码语言:javascript
复制
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:bnu="http://bootsfaces.net/ui">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>My Page</title>
    </h:head>
    <h:body>
        <p:layout fullPage="true">

            <p:layoutUnit position="north" size="100" resizable="false" closable="false" collapsible="false" >
                <h1>PAGE</h1>

            </p:layoutUnit>


            <p:layoutUnit position="west" size="195" header="Panel" resizable="true" closable="false" collapsible="true" >
                <h:form id="form" >

                    <p:menu>
                        <p:menuitem id="abc" value="Inicio" action="#{bean.page0()}" update=":content:pcenter" />
                        <p:submenu label="ABC" >
                            <p:menuitem id="X1" value="CC1" action="#{bean.page1()}" update=":content:pcenter"/>
                            <p:menuitem id="X2" value="CC2" action="#{bean.page2()}" update=":content:pcenter"/>
                            <p:menuitem id="X3" value="CC3" action="#{bean.page3()}" update=":content:pcenter"/>
                        </p:submenu>
                    </p:menu>

                </h:form>
            </p:layoutUnit>

            <p:layoutUnit position="center" header="Welcome user" >
                <h:form id="content">
                    <p:panel id="pcenter">
                        <ui:include src="#{bean.page}.xhtml" />
                    </p:panel>
                 </h:form>
            </p:layoutUnit>

            <p:layoutUnit position="south" size="100" header="Bottom" resizable="false" closable="false" collapsible="false">
                <h:outputText value="South unit content." />
            </p:layoutUnit>

        </p:layout>         
    </h:body>
</html>

我尝试了一下,并没有显示样式look="success“,而是显示了标题

代码语言:javascript
复制
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:bnu="http://bootsfaces.net/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <bnu:panel id="pdata" title="User data" collapsible="true" look="success">
           <p:outputLabel value="Name" for="txt_name"/>
                <p:inputText id="txt_name" label="Name" required="true">
                </p:inputText>
    </bnu:panel>
</html>

我试过了,同样的

代码语言:javascript
复制
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
    xmlns:ui="http://java.sun.com/jsf/facelets">

    <bnu:panel id="pdata" title="User data" collapsible="true" look="success">
           <p:outputLabel value="Name" for="txt_name"/>
                <p:inputText id="txt_name" label="Name" required="true">
                </p:inputText>
    </bnu:panel>
</ui:composition>

并尝试这样做,工作,但不加载页面的中心时,点击左侧菜单的元素

代码语言:javascript
复制
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:bnu="http://bootsfaces.net/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

   <head>
   </head>
    <bnu:panel id="pdata" title="User data" collapsible="true" look="success">
           <p:outputLabel value="Name" for="txt_name"/>
                <p:inputText id="txt_name" label="Name" required="true">
                </p:inputText>
    </bnu:panel>
</html>
EN

回答 1

Stack Overflow用户

发布于 2015-09-16 19:49:02

实际上,这三个版本中的每一个都可以工作。我已经基于您的XHTML页面创建了一个项目,它可以完美地运行。无论有没有PrimeFaces引导主题。所以我最好的猜测是你的项目设置有问题。

我建议你从https://github.com/stephanrauh/BootsFaces-Examples/tree/master/PrimeFacesLayout查看我的例子,并尝试找出与你的项目的区别。

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

https://stackoverflow.com/questions/32599781

复制
相关文章

相似问题

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