Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 2 Primefaces组件-颜色选择器:弹出窗口不渲染,_Jsf 2_Primefaces - Fatal编程技术网

Jsf 2 Primefaces组件-颜色选择器:弹出窗口不渲染,

Jsf 2 Primefaces组件-颜色选择器:弹出窗口不渲染,,jsf-2,primefaces,Jsf 2,Primefaces,我在我的JBossWebApp中集成了两个Primefaces“p:colorPicker”、一个“p:inputTextarea”和两个“p:commandButton”。我们的想法是在点击“p:commandButton”“update Url”(请查找下面的代码)之后,选择一种颜色并通过ajax更新“p:inputTextarea”中提供的链接 这是我第一次尝试将Primefaces集成到我的webapp中(通过Maven)。在运行应用程序时,我可以看到“p:inputTextarea”和

我在我的JBossWebApp中集成了两个Primefaces“p:colorPicker”、一个“p:inputTextarea”和两个“p:commandButton”。我们的想法是在点击“p:commandButton”“update Url”(请查找下面的代码)之后,选择一种颜色并通过ajax更新“p:inputTextarea”中提供的链接

这是我第一次尝试将Primefaces集成到我的webapp中(通过Maven)。在运行应用程序时,我可以看到“p:inputTextarea”和两个“p:commandButtons”被正确渲染。我可以调整“p:InputExtArea”的大小,然后点击“更新Url”刷新“p:InputExtArea”。所以我假设Primefaces的集成是有效的

我遇到的问题是“p:colorPicker”: 我可以看到按钮的Primefaces样式,但是colorPicker弹出窗口没有显示,因此我不能选择任何颜色。在这种情况下,我使用的是默认模式。当我尝试使用mode=inline时,整个组件没有被渲染

你能给我一些关于如何解决这个问题的提示吗? 如果您需要更多信息或代码,请告诉我

提前谢谢大家,

艾伦

代码如下:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
template="WEB-INF/templates/default.xhtml">

<ui:define name="content">
    <h1>Spendenformular bearbeiten</h1>



    <h:form>

        <h:panelGrid columns="2">
            <h:outputLabel value="Hintergrundfarbe:"/>
            <p:colorPicker id="bgColor"
                value="#{spendeFormEditController.bgColor}"
                widgetVar="bgPicker">
            </p:colorPicker>
            <h:outputLabel value="Textfarbe:"/>
            <p:colorPicker id="textColor"
                value="#{spendeFormEditController.textColor}"
                widgetVar="textPicker">
            </p:colorPicker>
            <h:outputLabel value="URL des Formulars:" />
            <p:inputTextarea id="url" rows="6" cols="30" readonly="true"
                value="#{spendeFormEditController.url}" />
        </h:panelGrid>

        <p:commandButton value="Update URL" update="url" />
        <p:commandButton value="OK"
            action="#{spendeFormEditController.doOk}" ajax="false"/>

    </h:form>

</ui:define>

斯宾登公式

以防我使用的模板:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.comcom/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
    <title>My-Aktion</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <h:outputStylesheet name="css/screen.css" />
</h:head>

<h:body>
    <div id="container">
        <div id="header">
            <p>
                Beispielanwendung <b>My-Aktion</b> - Workshop Java EE 7
            </p>
        </div>
        <div id="content">
            <ui:insert name="content">
                [Template content will be inserted here]
            </ui:insert>
        </div>
        <div id="footer">
            <p> (C) 2013 com.fantasma</p>
        </div>
    </div>

</h:body>

我的祈祷

贝斯皮兰文东我的工作坊-爪哇EE 7

[模板内容将插入此处] (C)2013年com.fantasma

编辑:
嗨,极限车手:谢谢你的回复

我使用的是Primefaces 3.5版和Mozlla Firefox 25.0

然而,与此同时,我试图在我的webapp的另一个视图上做一些更改,我可以看到PF实际上不起作用

正如我之前所说的,我将JBoss与Maven一起使用。因此,我通过Maven安装了PF,并在pom.xml中进行了必要的更改。据我目前所知,PF.jar已经下载到了.m2文件中

我可以在Eclipse中找到.jar:target->myaktion(=project)->WEB-INF->lib

在那里我可以找到两个版本的PF!3.3和3.5是否存在冲突?我必须单独检查JBoss中的部署吗(我怎么做)

提前谢谢你,艾伦

以下是pom.xml文件: http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0

<groupId>com.fantasma</groupId>
<artifactId>my-aktion</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Java EE 6 webapp project</name>
<description>A starter Java EE 6 webapp project for use on JBoss AS 7.1 / EAP 6, generated from the jboss-javaee6-webapp archetype</description>

<properties>
    <!-- Explicitly declaring the source encoding eliminates the following 
        message: -->
    <!-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered 
        resources, i.e. build is platform dependent! -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- Define the version of JBoss' Java EE 6 APIs and Tools we want 
        to import. -->
    <jboss.bom.version>1.0.0.Final</jboss.bom.version>
    <!-- Alternatively, comment out the above line, and un-comment the 
        line below to use version 1.0.0.M12-redhat-1 which is a release certified 
        to work with JBoss EAP 6. It requires you have access to the JBoss EAP 6 
        maven repository. -->
    <!-- <jboss.bom.version>1.0.0.M12-redhat-1</jboss.bom.version>> -->
</properties>


<dependencyManagement>
    <dependencies>
        <!-- JBoss distributes a complete set of Java EE 6 APIs including 
            a Bill of Materials (BOM). A BOM specifies the versions of a "stack" (or 
            a collection) of artifacts. We use this here so that we always get the correct 
            versions of artifacts. Here we use the jboss-javaee-6.0-with-tools stack 
            (you can read this as the JBoss stack of the Java EE 6 APIs, with some extras 
            tools for your project, such as Arquillian for testing) and the jboss-javaee-6.0-with-hibernate 
            stack you can read this as the JBoss stack of the Java EE 6 APIs, with extras 
            from the Hibernate family of projects) -->
        <dependency>
            <groupId>org.jboss.bom</groupId>
            <artifactId>jboss-javaee-6.0-with-tools</artifactId>
            <version>${jboss.bom.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.bom</groupId>
            <artifactId>jboss-javaee-6.0-with-hibernate</artifactId>
            <version>${jboss.bom.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>3.5</version>
        </dependency>

    </dependencies>
</dependencyManagement>

<dependencies>

    <!-- First declare the APIs we depend on and need for compilation. 
        All of them are provided by JBoss AS 7 -->

    <!-- Import the CDI API, we use provided scope as the API is included 
        in JBoss AS 7 -->
    <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <scope>provided</scope>
    </dependency>

    <!-- Import the Common Annotations API (JSR-250), we use provided 
        scope as the API is included in JBoss AS 7 -->
    <dependency>
        <groupId>org.jboss.spec.javax.annotation</groupId>
        <artifactId>jboss-annotations-api_1.1_spec</artifactId>
        <scope>provided</scope>
    </dependency>

    <!-- Import the JAX-RS API, we use provided scope as the API is included 
        in JBoss AS 7 -->
    <dependency>
        <groupId>org.jboss.spec.javax.ws.rs</groupId>
        <artifactId>jboss-jaxrs-api_1.1_spec</artifactId>
        <scope>provided</scope>
    </dependency>

    <!-- Import the JPA API, we use provided scope as the API is included 
        in JBoss AS 7 -->
    <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.0-api</artifactId>
        <scope>provided</scope>
    </dependency>

    <!-- Import the EJB API, we use provided scope as the API is included 
        in JBoss AS 7 -->
    <dependency>
        <groupId>org.jboss.spec.javax.ejb</groupId>
        <artifactId>jboss-ejb-api_3.1_spec</artifactId>
        <scope>provided</scope>
    </dependency>

    <!-- JSR-303 (Bean Validation) Implementation -->
    <!-- Provides portable constraints such as @Email -->
    <!-- Hibernate Validator is shipped in JBoss AS 7 -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <scope>provided</scope>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <!-- Import the JSF API, we use provided scope as the API is included 
        in JBoss AS 7 -->
    <dependency>
        <groupId>org.jboss.spec.javax.faces</groupId>
        <artifactId>jboss-jsf-api_2.1_spec</artifactId>
        <scope>provided</scope>
    </dependency>

    <!-- Now we declare any tools needed -->


    <!-- Annotation processor to generate the JPA 2.0 metamodel classes 
        for typesafe criteria queries -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-jpamodelgen</artifactId>
        <scope>provided</scope>
    </dependency>

    <!-- Annotation processor that raising compilation errors whenever 
        constraint annotations are incorrectly used. -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator-annotation-processor</artifactId>
        <scope>provided</scope>
    </dependency>

    <!-- Needed for running tests (you may also use TestNG) -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
    </dependency>

    <!-- Optional, but highly recommended -->
    <!-- Arquillian allows you to test enterprise code such as EJBs and 
        Transactional(JTA) JPA from JUnit/TestNG -->
    <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.jboss.arquillian.protocol</groupId>
        <artifactId>arquillian-protocol-servlet</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.jboss.spec.javax.servlet</groupId>
        <artifactId>jboss-servlet-api_3.0_spec</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <!-- Maven will append the version to the finalName (which is the 
        name given to the generated war, and hence the context root) -->
    <finalName>${project.artifactId}</finalName>
    <plugins>
        <!-- Compiler plugin enforces Java 1.6 compatibility and activates 
            annotation processors -->
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
                <!-- Java EE 6 doesn't require web.xml, Maven needs to 
                    catch up! -->
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
        <!-- The JBoss AS plugin deploys your war to a local JBoss AS 
            container -->
        <!-- To use, run: mvn package jboss-as:deploy -->
        <plugin>
            <groupId>org.jboss.as.plugins</groupId>
            <artifactId>jboss-as-maven-plugin</artifactId>
            <version>7.1.1.Final</version>
        </plugin>
    </plugins>
</build>

<profiles>
    <profile>
        <!-- The default profile skips all tests, though you can tune 
            it to run just unit tests based on a custom pattern -->
        <!-- Seperate profiles are provided for running all tests, including 
            Arquillian tests that execute in the specified container -->
        <id>default</id>
        <repositories>  
            <repository>
                <id>prime-repo</id>
                <name>Primefaces Maven Repository</name>
                <url>http://repository.primefaces.org</url>
            </repository>
        </repositories>

        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.4.3</version>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

    <profile>
        <!-- An optional Arquillian testing profile that executes tests 
            in your JBoss AS instance -->
        <!-- This profile will start a new JBoss AS instance, and execute 
            the test, shutting it down when done -->
        <!-- Run with: mvn clean test -Parq-jbossas-managed -->
        <id>arq-jbossas-managed</id>
        <repositories>  
            <repository>
                <id>prime-repo</id>
                <name>Primefaces Maven Repository</name>
                <url>http://repository.primefaces.org</url>
            </repository>
        </repositories>
        <dependencies>
            <dependency>
                <groupId>org.jboss.as</groupId>
                <artifactId>jboss-as-arquillian-container-managed</artifactId>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </profile>

    <profile>
        <!-- An optional Arquillian testing profile that executes tests 
            in a remote JBoss AS instance -->
        <!-- Run with: mvn clean test -Parq-jbossas-remote -->
        <id>arq-jbossas-remote</id>
        <repositories>  
            <repository>
                <id>prime-repo</id>
                <name>Primefaces Maven Repository</name>
                <url>http://repository.primefaces.org</url>
            </repository>
        </repositories> 
        <dependencies>
            <dependency>
                <groupId>org.jboss.as</groupId>
                <artifactId>jboss-as-arquillian-container-remote</artifactId>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </profile>

    <profile>
        <!-- When built in OpenShift the 'openshift' profile will be 
            used when invoking mvn. -->
        <!-- Use this profile for any OpenShift specific customization 
            your app will need. -->
        <!-- By default that is to put the resulting archive into the 
            'deployments' folder. -->
        <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
        <id>openshift</id>
        <repositories>  
            <repository>
                <id>prime-repo</id>
                <name>Primefaces Maven Repository</name>
                <url>http://repository.primefaces.org</url>
            </repository>
        </repositories>
        <dependencies>

        </dependencies>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1.1</version>
                    <configuration>
                        <outputDirectory>deployments</outputDirectory>
                        <warName>ROOT</warName>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

</profiles>
com.fantasma
我的祈祷
1.0-快照
战争
JavaEE6WebApp项目
从JBoss-javaee6-webapp原型生成的用于JBoss AS 7.1/EAP 6的初学者Java EE 6 webapp项目
UTF-8
1.0.0.1决赛
org.jboss.bom
jboss-javaee-6.0-with-tools
${jboss.bom.version}
聚甲醛
进口
org.jboss.bom
jboss-javaee-6.0-with-hibernate
${jboss.bom.version}
聚甲醛
进口
org.primefaces
素面
3.5
javax.enterprise
CDIAPI
假如
org.jboss.spec.javax.annotation
jboss-annotations-api_1.1_规范
假如
org.jboss.spec.javax.ws.rs
jboss-jaxrs-api_1.1_规范
假如
org.hibernate.javax.persistence
hibernate-jpa-2.0-api
假如
org.jboss.spec.javax.ejb
jboss-ejb-api_3.1_规范
假如
org.hibernate
休眠验证器
假如
org.slf4j
slf4j api
org.jboss.spec.javax.faces
jboss-jsf-api_2.1_规范
假如
org.hibernate
冬眠
假如
org.hibernate
hibernate验证程序注释处理器
假如
朱尼特
朱尼特
测试
org.jboss.arquillian.junit
arquillian junit容器
测试
org.jboss.arquillian.protocol
arquillian协议servlet
测试
org.jboss.spec.javax.servlet
jboss-servlet-api_3.0_规范
假如
org.primefaces
素面
假如
${project.artifactId}
maven编译器插件
2.3.1
1.7
1.7
maven战争插件
2.1.1
假的
org.jboss.as.plugins
jboss作为maven插件
7.1.1.最终版本
违约
优质回购
PrimeFacesMaven存储库
http://repository.primefaces.org
真的
maven surefire插件
2.4.3
真的
arq jbossas管理
优质回购
PrimeFacesMaven存储库
http://repository.primefaces.org
org.jboss.as
jboss作为arquillian容器管理
测试
ARQJBO