2 Replies Latest reply on Jan 30, 2013 9:37 AM by songjinglim

    Richface popup not working in GAE

    songjinglim Newbie

      Base on example from richface showcase:

      http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=popup&sample=simplePopup&skin=blueSky

       

      When I call the popup using #{rich:component, nothing happen (ie. no popup):

       

          <a4j:commandLink styleClass="no-decor" execute="@this"

             oncomplete="#{rich:component('popup')}.show()">

       

      However when I change to using  <rich:componentControl, popup appear

       

          <a4j:commandLink styleClass="no-decor" execute="@this">

            <rich:componentControl target="popup" operation="show" />

       

      Note: Both work find from GAE when I run from my local notebook but problem happen when I deploy to GAE online (http://cloudenterpriseapps.appspot.com/public/test/testPopup.jsf)

       

      Any help?

        • 1. Re: Richface popup not working in GAE
          Michal Petrov Master

          Hi,

           

          have you solved it already? Everything seems to be working on the link you posted, in Chrome at least. (Except the panel cannot be closed with 'X', you are calling .hide() on nothing)

          • 2. Re: Richface popup not working in GAE
            songjinglim Newbie

            Hi Michal,

             

            Thanks for reply

             

            Just solved by adding

             

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

             

            Here the complete code and now work fine.

             

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