0

基于来自 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

有什么帮助吗?

4

1 回答 1

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>
于 2013-01-30T14:39:42.727 回答