Richfaces弹出窗口无法在GAME中运行

时间:2013-01-30 00:22:27

标签: google-app-engine popup richfaces

基于richface展示的示例: http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=popup&sample=simplePopup&skin=blueSky

当我使用#{rich:component调用弹出窗口时,没有任何事情发生(即没有弹出窗口):

<a4j:commandLink styleClass="no-decor" execute="@this"
   oncomplete="#{rich:component('popup')}.show()">

但是,当我更改为使用rich:componentControl时,会出现弹出窗口

<a4j:commandLink styleClass="no-decor" execute="@this">
  <rich:componentControl target="popup" operation="show" /> 

注意:当我从本地笔记本运行时,两个工作都从GAE中找到,但是当我在线部署到GAE时出现问题(http://cloudenterpriseapps.appspot.com/public/test/testPopup.jsf

任何帮助?

1 个答案:

答案 0 :(得分:0)

刚刚添加

解决了
<a4j:status onstart="#{rich:component('statPane')}.show()"
    onstop="#{rich:component('statPane')}.hide()" />
...
<rich:popupPanel id="statPane" autosized="true">
    <h:graphicImage value="/images/common/ai.gif" alt="ai" />
    Please wait...
</rich:popupPanel>

这里有完整的代码,现在工作正常。

<!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:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:c="http://java.sun.com/jsp/jstl/core">

<ui:composition>
    <h:head>
        <title>RichFaces Showcase</title>
    </h:head>
    <h:body>

        <a4j:status onstart="#{rich:component('statPane')}.show()"
            onstop="#{rich:component('statPane')}.hide()" />

        <a4j:commandLink styleClass="no-decor" execute="@this" render="@none"
            action="#{dummyBean.methodCall}"
            oncomplete="#{rich:component('popup')}.show()">
            <h:graphicImage value="/images/icons/common/edit.gif" alt="edit" />
        </a4j:commandLink>

        <h:form id="myform">
            <rich:popupPanel id="popup" modal="false" autosized="true"
                resizeable="false">

                <f:facet name="header">
                    <h:outputText value="Simple popup panel" />
                </f:facet>
                <f:facet name="controls">
                    <h:outputLink value="#"
                        onclick="#{rich:component('popup')}.hide(); return false;">
                X
            </h:outputLink>
                </f:facet>
                <p>Any content might be inside this panel.</p>

                <p>
                    The popup panel is open and closed from the javascript function of
                    component client side object. The following code <a href="#"
                        onclick="#{rich:component('popup')}.hide()">hide this panel</a>:
                    <f:verbatim>&#35;</f:verbatim>
                    {rich:component('popup')}.hide()
                </p>

                <a4j:commandButton value="Close" styleClass="no-decor"
                    execute="@this" render="@none" action="#{dummyBean.methodCall2}"
                    oncomplete="#{rich:component('popup')}.hide()"/>

                <br />
            </rich:popupPanel>
        </h:form>

        <rich:popupPanel id="statPane" autosized="true">
            <h:graphicImage value="/images/common/ai.gif" alt="ai" />
            Please wait...
        </rich:popupPanel>

    </h:body>
</ui:composition>
</html>