9 Replies Latest reply on Nov 2, 2009 2:25 AM by sunay

    Queue:: New Bie

    sunay

      Hello All,

      I am new to richfaces , i gone through the documentation, but not able to understand the behavior of queue. My Scenario is like this.

      I have one Rich datatable with datascroller, now when ever i am selecting Menu the grid is updated. I debug my code and i found that it sends multiple request. so for streamline the request i use queue. But the problem is that my view of the data table not updated after consecutive request.

        • 1. Re: Queue:: New Bie
          sunay

          I can't see my tables data updated. but when i click on refresh it again shows the correct data.

          • 2. Re: Queue:: New Bie
            ilya_shaikovsky

            show your code.

            • 3. Re: Queue:: New Bie
              sunay

              Thanks for the reply

              here goes the code


              <a4j:queue id="dataQueue"/>
              <a4j:region id="dataPanel">
              <rich:dataTable align="center" value="#{definitionList.genericList}" var="pd"
              rowClasses="row1, row2" id="pdlist" rows="15"
              columnClasses="50,100,100,100"
              onRowMouseOver="this.style.backgroundColor='#B5F3FB'"
              onRowMouseOut="this.style.backgroundColor='#{a4jSkin.rowBackgroundColor}'"
              >
              
              <f:facet name="header">
              <rich:columnGroup>
              <rich:column colspan="6">
              <h:outputText value="Contracts By Category" rendered="#{type == 'contracts'}"/>
              <h:outputText value="Other Contract Sub Processes" rendered="#{type != 'contracts'}"/>
              </rich:column>
              </rich:columnGroup>
              </f:facet>
              <rich:column filterBy="#{pd.id}" sortBy="#{pd.id}" filterEvent="onkeyup" headerClass="idcolumn" sortOrder="DESCENDING">
              <f:facet name="header">
              
              <h:outputText value="ID" />
              </f:facet>
              <h:outputText value="#{pd.id}" />
              </rich:column>
              <f:facet name="footer" style="text-align:center;">
              <h:panelGroup>
              <rich:datascroller id="ds" renderIfSinglePage="false" reRender="pdlist" limitToList="true" style="tablescroll" >
              </rich:datascroller>
              <rich:spacer height="18" />
              <h:commandButton value="Add New Contract" onclick="document.location.href='deployproc.jsf';return false;" class="footerbutton"/>
              </h:panelGroup>
              </f:facet>
              </rich:dataTable>
              </a4j:region>
              


              • 4. Re: Queue:: New Bie
                sunay

                scenario is like this.

                i have two menu say menu A and Menu B, when i click on Menu A it will comes with different data and on clicking on Menu B it shows diff.data now problem is like when i click on menu A then it comes with right data. when i am clicking on menu B it gives right data but after two or three time data are interchanged with each other contents if you click refresh then again come up with right data. I think because of multiple request it is not able to render the grid some time. I have wrote queue code as shown above. then it should re render the code after second request.

                Thanks for the reply in advanced. I am very new to JSF and Richfaces. Also tell me the right reference tutorial for both technologies,


                Thanks

                • 5. Re: Queue:: New Bie
                  nbelaevski
                  • 6. Re: Queue:: New Bie
                    sunay

                    yes it is the same one

                    • 7. Re: Queue:: New Bie
                      nbelaevski
                      • 8. Re: Queue:: New Bie
                        nbelaevski

                        I'm looking at the posted code and there neither "A" and "B" menu items, nor "X" and "Y". Can you please be more precise in describing the issue? E.g. you can give all affected components IDs and refer to them.

                        • 9. Re: Queue:: New Bie
                          sunay

                          Problem solved :)

                          Thank you all for your kind replies. With The help of queue and Synchronized keyword for method solved my problem