12 Replies Latest reply on Jul 27, 2011 12:58 AM by teeradej

    Cannot use rich:popupPanel with IE8, 9

    teeradej

      Hi All,

       

      I would like to implement the popup by using Richfaces4 but it's not fire as follow

       

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

          </rich:popupPanel>

       

      Please someone help me out of problem

       

      Thank for any help

      Teeradej

        • 1. Re: Cannot use rich:popupPanel with IE8, 9
          iabughosh

          Hi Teeradej,

          please post a larger snippet of your xhtml page showing the h:form and the command which will show the popup.

          • 2. Re: Cannot use rich:popupPanel with IE8, 9
            teeradej

            Hi Ibrahim,

             

            Thank you for your reply, My full source code is

             

            <ui:composition xmlns="http://www.w3.org/1999/xhtml"

                  xmlns:ui="http://java.sun.com/jsf/facelets"

                  xmlns:h="http://java.sun.com/jsf/html"

                  xmlns:f="http://java.sun.com/jsf/core"

                  xmlns:a4j="http://richfaces.org/a4j"

                  xmlns:rich="http://richfaces.org/rich">

                 

            <h:head>

            <title><ui:insert name="pageTitle">Demo</ui:insert></title>

            </h:head>

            <h:body>

                <h:form id="form">

                <h:commandButton value="Call the popup">

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

                </h:commandButton>

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

                </rich:popupPanel>

                </h:form>

            </h:body>

            </ui:composition>

            • 3. Re: Cannot use rich:popupPanel with IE8, 9
              iabughosh

              check this :

               

              <?xml version='1.0' encoding='UTF-8' ?>

              <!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:ui="http://java.sun.com/jsf/facelets"

                    xmlns:a4j="http://richfaces.org/a4j"

                    xmlns:rich="http://richfaces.org/rich"

                    xmlns:f="http://java.sun.com/jsf/core">

               

               

              <h:head>

              <title><ui:insert name="pageTitle">Demo</ui:insert></title>

              </h:head>

              <h:body>

                  <h:form id="form">

                  <h:commandButton value="Call the popup">

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

                  </h:commandButton>

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

                  </rich:popupPanel>

                  </h:form>

              </h:body>

              </html>

              • 4. Re: Cannot use rich:popupPanel with IE8, 9
                teeradej

                Hi Ibrahim,

                 

                You are correct one. Unfortunately my application cannot use html tag as header because when I use html tag, the data poll function cannot work fire.

                 

                My data polling :

                 

                       <h:form>

                          <a4j:region>

                            <a4j:poll id="mainpoll" interval="3000" enabled="#{pollBean.pollEnabled}" render="eventstabletab1, alertstabletab1, mainpoll, controlbtn, serverDate" />

                          </a4j:region>

                        </h:form>

                        <h:form>

                          <rich:toolbar height="26" itemSeparator="grid">

                            <rich:toolbarGroup location="left">

                              <h:panelGrid columns="2" width="400" id="grid">

                                <a4j:commandButton id="controlbtn" value="#{pollBean.pollEnabled?'Stop':'Start'} Polling" render="eventstabletab1, alertstabletab1, mainpoll, controlbtn, serverDate" styleClass="button2" >

                                  <a4j:param name="polling" value="#{!pollBean.pollEnabled}" assignTo="#{pollBean.pollEnabled}" />

                                </a4j:commandButton>

                                <h:outputText id="serverDate" style="font-size:11px" value="Server Date: #{pollBean.date}" />

                              </h:panelGrid>

                            </rich:toolbarGroup>

                          </rich:toolbar>

                        </h:form>

                 

                Thank for your help

                Teeradej

                • 5. Re: Cannot use rich:popupPanel with IE8, 9
                  iabughosh

                  it should work even with html header see this code :

                   

                  <?xml version='1.0' encoding='UTF-8' ?>

                  <!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:ui="http://java.sun.com/jsf/facelets"

                        xmlns:a4j="http://richfaces.org/a4j"

                        xmlns:rich="http://richfaces.org/rich"

                        xmlns:f="http://java.sun.com/jsf/core">

                   

                   

                  <h:head>

                  <title><ui:insert name="pageTitle">Demo</ui:insert></title>

                  </h:head>

                  <h:body>

                      <h:form id="form">

                          <a4j:poll id="myPoll" interval="10000" ontimer="window.alert('timed out');"/>  

                      </h:form>

                  </h:body>

                  </html>

                  1 of 1 people found this helpful
                  • 6. Re: Cannot use rich:popupPanel with IE8, 9
                    teeradej

                    Hi Ibrahim,

                     

                    You are correct and I still have a problem again . I can use "ontimer" function but I cannot use "render" function because I need to refresh my data every few minutes.

                     

                    Thank you for your help

                    Teeradej

                    • 7. Re: Cannot use rich:popupPanel with IE8, 9
                      iabughosh

                      i think it is possible, check this :

                      <a4j:poll id="myPoll"

                                        interval="10000"

                                        actionListener="#{mybean.getDataFromDB}"

                                        execute="text"

                                        render="text"/>

                              <h:outputText id="text" value="#{mybean.myValue}"/>

                      1 of 1 people found this helpful
                      • 8. Re: Cannot use rich:popupPanel with IE8, 9
                        teeradej

                        I have the error like this

                         

                        Jul 26, 2011 8:03:16 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute

                        WARNING: javax.el.MethodNotFoundException: Method not found: org.richfaces.demo.poll.PollBean@8a8b1e.date(javax.faces.event.ActionEvent)

                        javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: Method not found: org.richfaces.demo.poll.PollBean@8a8b1e.date(javax.faces.event.ActionEvent)

                            at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:92)

                            at javax.faces.component.UICommand.broadcast(UICommand.java:308)

                            at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)

                            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)

                            at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)

                            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

                            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

                            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)

                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)

                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

                            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)

                            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)

                            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)

                            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)

                            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)

                            at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)

                            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

                            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)

                         

                         

                        My code :

                         

                        <a4j:poll id="myPoll" interval="10000" actionListener="#{pollBean.date}" execute="text" render="text"/>

                        <h:outputText id="text" value="#{pollBean.date}"/>

                         

                        ======================================================

                        PollBean.java

                         

                            public Date getDate() {

                                Date date = new Date();

                                if (null == pollStartTime) {

                                    pollStartTime = new Date();

                                    return date;

                                }

                                if ((date.getTime() - pollStartTime.getTime()) >= POLL_DISABLEMENT_INTERVAL) {

                                    setPollEnabled(false);

                                }

                                return date;

                            }

                        ======================================================

                        web.xml


                        <?xml version="1.0"?>

                        <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"

                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

                         

                             <display-name>EveRich4</display-name>

                         

                            <context-param>

                                <param-name>contextConfigLocation</param-name>

                                <param-value>/WEB-INF/applicationContext.xml</param-value>

                            </context-param>

                         

                         

                            <context-param>

                                <param-name>javax.faces.FACELETS_LIBRARIES</param-name>

                                <param-value>/WEB-INF/app-tags.taglib.xml</param-value>

                            </context-param>

                            <context-param>

                                <param-name>javax.faces.PROJECT_STAGE</param-name>

                                <param-value>Development</param-value>

                            </context-param>

                            <context-param>

                                <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

                                <param-value>server</param-value>

                            </context-param>

                           

                            <context-param>

                                <param-name>org.richfaces.skin</param-name>

                                <param-value>#{skinBean.skin}</param-value>

                            </context-param>

                         

                            <listener>

                                <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

                            </listener>

                            <listener>

                                <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

                            </listener>

                            <servlet>

                                <servlet-name>Faces Servlet</servlet-name>

                                <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

                                <load-on-startup>1</load-on-startup>

                            </servlet>

                            <servlet-mapping>

                                <servlet-name>Faces Servlet</servlet-name>

                                <url-pattern>*.jsf</url-pattern>

                            </servlet-mapping>

                           

                            <servlet>

                                <servlet-name>LOG4J</servlet-name>

                                <servlet-class>de.osedata.eve.servlet.Log4JInitServlet</servlet-class>

                                <init-param>

                                    <param-name>log4j-init-file</param-name>

                                    <param-value>WEB-INF/log4j.properties</param-value>

                                </init-param>

                                <load-on-startup>2</load-on-startup>

                            </servlet>

                         

                            <welcome-file-list>

                                <welcome-file>index.html</welcome-file>

                                <welcome-file>index.htm</welcome-file>

                                <welcome-file>index.jsp</welcome-file>

                            </welcome-file-list>

                         

                            <mime-mapping>

                                <extension>xcss</extension>

                                <mime-type>text/css</mime-type>

                            </mime-mapping>

                            <login-config>

                                <auth-method>BASIC</auth-method>

                            </login-config>

                         

                            <session-config>

                                <session-timeout>30</session-timeout>

                            </session-config>

                        </web-app>

                         

                        Thank you for your help

                        Teeradej

                        • 9. Re: Cannot use rich:popupPanel with IE8, 9
                          iabughosh

                          your Poll bean code shall be like this

                          PollBean.java

                           

                           

                               private Date date;

                           

                              public Date getDate() {      

                                  return date;

                              }

                           

                               public void fillDateData(javax.faces.event.ActionEvent ae) {

                                    //set your date

                                    //ex: date = new Date();

                               }

                           

                          and your xhtml :

                          <a4j:poll id="myPoll" interval="10000" actionListener="#{pollBean.fillDateData}" execute="text" render="text"/>

                          <h:outputText id="text" value="#{pollBean.date}"/>

                          • 10. Re: Cannot use rich:popupPanel with IE8, 9
                            teeradej

                            Hi Ibrahim,

                             

                            I have implement following your suggestion but it still no fire. it doesn't refresh all the time.

                             

                            test.xhtml

                            <!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:ui="http://java.sun.com/jsf/facelets"

                                  xmlns:a4j="http://richfaces.org/a4j"

                                  xmlns:rich="http://richfaces.org/rich"

                                  xmlns:f="http://java.sun.com/jsf/core">

                                 

                            <h:head>

                            <title><ui:insert name="pageTitle">Demo</ui:insert></title>

                            </h:head>

                            <h:body>

                            <a4j:poll id="myPoll" interval="1000" actionListener="#{pollBean.fillDateData}" execute="text" render="text"/>

                            <h:outputText id="text" value="#{pollBean.date}"/>

                            </h:body>

                            </html>

                            =======================================================

                            PollBean.java

                            @ManagedBean

                            @SessionScoped

                            public class PollBean implements Serializable {

                             

                                private static final long serialVersionUID = 1L;

                                private Date date;

                               

                                public Date getDate() {     

                                    return date;

                                }

                                public void fillDateData(javax.faces.event.ActionEvent ae) {

                                    date = new Date();

                                    System.out.println(date);

                                }

                            }

                             

                             

                            Please get me out of this problem.

                            Thank you so much

                            Teeradej

                            • 11. Re: Cannot use rich:popupPanel with IE8, 9
                              iabughosh

                              because you didn't wrap it with h:form :

                              <h:form>

                              <a4j:poll id="myPoll" interval="1000" actionListener="#{pollBean.fillDateData}" execute="text" render="text"/>

                              <h:outputText id="text" value="#{pollBean.date}"/>

                              </h:form>

                               

                              regards.

                              • 12. Re: Cannot use rich:popupPanel with IE8, 9
                                teeradej

                                Hi Ibrahim,

                                 

                                Thank you so much!!! It's work fire

                                 

                                I have another question which post in JBoss forum

                                 

                                http://community.jboss.org/thread/170015?tstart=0

                                 

                                Could you help me?

                                 

                                Thank you for your help

                                Teeradej