3 Replies Latest reply on Jan 22, 2011 2:03 AM by ilya40umov

    Want to display the status message while rendering the image when tree node is clicked

    bhanu.sistla

      Currently i am displaying the rich tree in the left panel which has images, videos, pdf etc... and when user clicks on the particular link either image, pdf the image or pdf needs to be displayed at right panel. This is working fine with out any issues, when the image is huge one like tiff or dcm and it take time to display, while display i want to show the "progress bar" or status "Please wait..... Page is loding".

       

      Here is the tree code

       

          <rich:tree style="width:100%;" switchType="client"
          value="#{kmTree.rootNode}" var="item"
          adviseNodeOpened="#{kmTree.adviseNodeOpened}"
          adviseNodeSelected="#{kmTree.adviseNodeSelected}"
          nodeSelectListener="#{kmTree.processSelection}"
          ajaxSubmitSelection="true" showConnectingLines="false">
          <!--rich:treeNode iconLeaf="#{item.resource.iconPath}"
           icon="#{item.resource.iconPath}"
           rendered="#{item.resource.iconPath != null}">
           <h:outputText styleClass="text" value="#{item.resource.name}" />
          </rich:treeNode-->

                      <rich:treeNode onexpand="kmNodeExpanded(#{item.node.id});"
                          oncollapse="kmNodeCollapsed(#{item.node.id});"
                          rendered="#{!item.node.isFolder}"
                          reRender="__km_display"
                          limitToList="true">
                          <h:outputText styleClass="text" value="#{item.node.name}" />
                      </rich:treeNode>

                      <rich:treeNode onexpand="kmNodeExpanded(#{item.node.id});"
                          oncollapse="kmNodeCollapsed(#{item.node.id});"
                          rendered="#{item.node.isFolder}">
                          <h:outputText styleClass="text" value="#{item.node.name}" />
                      </rich:treeNode>
                 </rich:tree>

       

      Any help will be really helpfull

       

      Thanks

      Bhanu S

        • 1. Want to display the status message while rendering the image when tree node is clicked
          ilya40umov

          1) If it works with ajax you can use a4j:status:

          http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/a4j_status.html

          2) If it works with your custom JS you should do it by yourself on JS.

          3) If some data is loading after non-AJAX submit I'm afraid that it's not possible to show status. It can do only a browser.

          • 2. Want to display the status message while rendering the image when tree node is clicked
            bhanu.sistla

            Yes its ajax call only, i tried to <a4j:status some thing like this

             

                <rich:tree style="width:100%;" switchType="client"

                value="#{kmTree.rootNode}" var="item"

                adviseNodeOpened="#{kmTree.adviseNodeOpened}"

                adviseNodeSelected="#{kmTree.adviseNodeSelected}"

                nodeSelectListener="#{kmTree.processSelection}"

                ajaxSubmitSelection="true" status="waitStatus">

             

            <h:outputText styleClass="text" value="#{item.resource.name}" />

                </rich:treeNode-->

                            <rich:treeNode onexpand="kmNodeExpanded(#{item.node.id});"
                                oncollapse="kmNodeCollapsed(#{item.node.id});"
                                rendered="#{!item.node.isFolder}"
                                reRender="__km_display"
                                limitToList="true">
                                <h:outputText styleClass="text" value="#{item.node.name}" />
                            </rich:treeNode>

                            <rich:treeNode onexpand="kmNodeExpanded(#{item.node.id});"
                                oncollapse="kmNodeCollapsed(#{item.node.id});"
                                rendered="#{item.node.isFolder}">
                                <h:outputText styleClass="text" value="#{item.node.name}" />
                            </rich:treeNode>
                       </rich:tree>

             

            <a4j:status
                id="waitStatus"
                forceId="true"
                onstart="javascript:Richfaces.showModalPanel('waitModalPanel');"
                onstop="javascript:Richfaces.hideModalPanel('waitModalPanel');"/>

            <rich:modalPanel
                id="waitModalPanel"
                autosized="true"
                width="200"
                height="120"
                moveable="false"
                resizeable="false">
                <f:facet name="header">
                    <h:outputText value="Processing"/>
                </f:facet>
                <h:outputText value="Please wait..."/>
            </rich:modalPanel>

             

             

            But this still did not work

             

            Thanks

            Bhanu S

            • 3. Want to display the status message while rendering the image when tree node is clicked
              ilya40umov

              1) I can't see h:form in your example. But I guess it must be somewere on your page. Please provide more detailed code.

              2) Try to debug JS with alert('message'); before using showModalPanel.

              3) So as I understood everything works fine and nodeSelectListener is fired and only a4j:status does not wokk. Am I right?