【问题标题】:Richface popup not working in GAERichfaces 弹出窗口在 GAME 中不起作用
【发布时间】:2013-01-30 00:22:27
【问题描述】:

基于 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)

有什么帮助吗?

【问题讨论】:

    标签: google-app-engine popup richfaces


    【解决方案1】:

    刚刚添加解决了

    <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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-02-16
      • 2012-08-22
      • 2017-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多