0

好的,新的 primefaces 错误(对我来说,无论如何)。在启动时我得到:

java.lang.NoClassDefFoundError: org/primefaces/event/SelectEvent

我正在使用 primefaces 3.3.1 并且刚刚验证与旧的 primefaces 版本没有冲突。有任何想法吗?下面是导致错误的 .xhtml。

<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui" >    

<h:head>

</h:head>
<h:body>
<center>
<h:form id="form">

<p:dataTable id="personTable" var="client" value="#{tableBean.persons}" paginator="true" rows="5"
             selection="#{tableBean.person}" selectionMode="single">

    <p:ajax event="rowSelect" listener="#{tableBean.onUserSelect}" update=":form:displayf" oncomplete="carDialog.show()" />  

    <p:ajax event="rowUnselect" listener="#{tableBean.onUserUnselect}" update=":form:displayf" />

    <f:facet name="header">
        Click "View" button after selecting a row to see details
    </f:facet>

    <p:column headerText="Name">
        #{client.name}
    </p:column>

    <p:column headerText="Address">
        #{client.address}
    </p:column>

    <p:column headerText="Phone" >
        #{client.phone}
    </p:column>

</p:dataTable>

<p:dialog id="dialog" header="Person Detail" widgetVar="personDialog" resizable="false"  
            showEffect="explode" hideEffect="explode">  

    <h:panelGrid id="displayf" columns="2" cellpadding="4">


        <h:outputText value="Name:" />
        <h:outputText value="#{tableBean.person.name}" />

        <h:outputText value="Address:" />
        <h:outputText value="#{tableBean.person.address}" />

        <h:outputText value="Phone:" />
        <h:outputText value="#{tableBean.person.phone}" />

    </h:panelGrid>
</p:dialog>

</h:form>

</center>
</h:body>
</html>
4

1 回答 1

0

好的,答案显然找到了。处理primefaces时:

  1. 不要使用 IE9/8 进行测试(或至少不是专门)。我发现一些代码根本无法与 microsoft 一起使用,但可以在 Firefox 中完美运行。

  2. 确保您使用的是兼容版本的 primefaces 和 jsf。我正在使用 primefaces 3.3.1 和 mojarra 2.1.1.,但要小心混合和匹配。

  3. 此外,primefaces 显然不完全向后兼容。一些较旧的教程可能不适用于较新版本的 primefaces。我注意到当前的用户手册/展示应用程序不能完全适用于旧的 2.2 primefaces 版本。

  4. 小心primefaces,它有一些好东西,但它是错误的,版本之间的差异可能导致各种问题。

于 2012-08-03T21:04:09.160 回答