11 Replies Latest reply on Mar 6, 2011 1:43 AM by Ilya Sorokoumov

    double click and css file problem

    kemal taskiran Newbie

      We are using jsf2 with richfaces 4 m6 in jboss 6 final. We made a content panel with facelet and using ajax support we change this panel dynamically. While doing this, we face with two problems,

      1- The commands buttons in the content panels are not response in the first click, after second click this works,

      2- Table css file sometimes is not loaded, so table is not works properly.

        • 1. double click and css file problem
          Rocky S Master

          Please post your code.

          • 2. Re: double click and css file problem
            kemal taskiran Newbie

            Hi Aman,

            This is our template file main-template.xhtml contains contentPanel as in the below,



            <f:view contentType="text/html">

                <f:loadBundle basename="messages" var="msgs" />


                    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

                    <h:outputStylesheet library="css" name="style.css" />

                    <h:outputStylesheet library="css" name="layout.css" />



                <h:body class="main-template">


                    <div id="content" class="content"><ui:insert name="content">


                        <a4j:outputPanel id="contentPanel">

                            <ui:include src="#{pageViewIdGenaratorBean.contentPage}" />









            pageViewGeneratorId.contentPage is changed managed bean,


            @ManagedBean(name = "pageViewIdGenaratorBean")


            public class PageViewIdGenaratorBean implements Serializable {


                private String contentPage = "/pages/content/mainPage.xhtml";


                public void sayfaSec(ActionEvent event) {

                    FacesContext context = FacesContext.getCurrentInstance();

                    String pageId = context.getExternalContext().getRequestParameterMap().get("page");


                    if (pageId.equalsIgnoreCase("userPage")) {

                        contentPage = "/content/userPage.xhtml";







            Our userPage.xhtml is,



                    <f:facet name="header">

                    User Add



                    <h:form id="userAddForm">


                        <h:panelGroup style="width:100%;">


                                action="#{userBean.add}" value="OK"


                                <f:param id="userParamAdd" name="page" value="userPage"></f:param>

                                <f:ajax render=":contentPanel" execute="@form"></f:ajax>








            Thank you for response, I will add the source code for css problem, and also in the post the double click problem is mentioned,







            • 3. Re: double click and css file problem
              kemal taskiran Newbie

              Hi Aman,

              Our css related problem occurs code in the below. And its picture is in the attached picture.


              My table code is,


              <rich:extendedDataTable value="#{kullaniciBean.kullaniciListesi}"


                                  style="width:800px;" var="kullanici"

                                  id="kullaniciTable" rows="10">

                                  <a4j:ajax execute="@form" event="selectionchange"


                                      render=":contentPanel" />


                                      <f:facet name="header">

                                          <h:outputText value="Giriş Adı " />


                                      <h:outputText value="#{kullanici.girisAdi}" />



                                      <f:facet name="header">

                                          <h:outputText value="Adı" />


                                      <h:outputText value="#{kullanici.adi}" />





                              <rich:dataScroller for="kullaniciTable" maxPages="5" />




              • 4. double click and css file problem
                liumin hu Master



                Could you try set contentPage default value to "userPage.xhtml"?



                • 5. double click and css file problem
                  kemal taskiran Newbie

                  Hi liu,


                  I am setting the contentPage default value "userPage.xhtml", but double click problem continues, hovewer css file for table is loaded but after changing the contentPage and then setting the contentPage "userPage.xhtml" table css file is not loaded again.




                  • 6. double click and css file problem
                    Rocky S Master

                    1) In your h:commandButton, use following attribute- onclick="document.getElementById(this).submit()"

                    2) CSS File not loading, make you have directory structure in your war file-


                    • 7. Re: double click and css file problem
                      kemal taskiran Newbie

                      Hi Aman,


                      While I am setting the onclick event as you say but problem is continues, hovewer as Liu said that when I am setting the default page userPage this problem solved for userPage or default page whichever I set, but when I am changing the contentPage dynamically as other page, this problem contiunes.


                      The css file is not our css file, richfaces table default css file, while we looking with firebug we couldn't see this file for table in the situation of which can be seen in picture.



                      • 8. double click and css file problem
                        Raúl Fernando Casallas Malaver Newbie

                        Hi, I'm having the same problem (double-click issue), i'm using facelets... maybe it is the problem?... there is not strange code... just a usual form:


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







                                  <ui:define name="title">

                                            <h:outputText value="#{msg['createAccount.title']}"/>


                                  <ui:define name="content">

                                 <h:form id="createAccountForm">

                                     <h:messages globalOnly="true" errorClass="errorClass" infoClass="infoClass" fatalClass="fatalClass" warnClass="warnClass" />

                                     <h:panelGrid columns="3" border="0">

                                         <h:outputLabel value="#{msg['createAccount.firstName']}" for="firstName" />

                                         <h:inputText label="#{msg['createAccount.firstName']}" value="#{accountBean.user.firstName}" id="firstName" required="true">

                                             <f:validateLength minimum="3" maximum="45" />

                                             <rich:validator />



                                     <h:panelGrid columns="2" border="0" width="80%">

                                         <a4j:commandButton render="createAccountForm" value="#{msg['createAccount.createAccount']}" action="#{accountBean.createAccount}" />

                                                                                    <a4j:commandButton render="createAccountForm" value="#{msg['createAccount.cancel']}" onclick="document.getElementById(this).submit()" action="cancel" immediate="true" />





                        • 9. double click and css file problem
                          liumin hu Master



                          i think the problem is ui:include. your "userPage.xhtml" is not present when creat view phase. so i suggested change the default page.


                          Could you try just reload your page(F5 or reenter the url) after navigate in userPage?



                          • 10. Re: double click and css file problem
                            kemal taskiran Newbie



                            I try to relaod after navigation and this works, but problem is continues. Finally we find a solution that we remove the forms in the contentPages that means inside of ui:define and insert a form outside of ui: include, than we refresh this form with f:ajax, than it works, so as you said this problem is related with ui:define.