6 Replies Latest reply on Sep 3, 2010 7:44 AM by Nikunj Gohel

    rich:tree usage help

    Eduard Demerchyan Newbie

      If you have any problem with rich:tree usage you may send me e-mail to edemerchan@yandex.ru with you problem

        • 1. Re: rich:tree usage help
          Max Rydahl Andersen Master

          .....what is wrong with posting the questions here ? :)

          • 2. Re: rich:tree usage help
            Eduard Demerchyan Newbie

            post here, no prpblem ;)

            • 3. Re: rich:tree usage help
              Steven Wright Newbie

              I am having a problem with the rich faces tree. We are using the Rich:tree with 3 recursive adapters in AJAX mode. The second and third nodes contain 1 or more check one boolean check boxes that also do an AJAX call using a4j:support.

              Here is the issue:

              1) Load the page with the tree in it.
              2) Expand a branch with a node that only has a single check box.
              3) Click the check box.

              When we click the check box it fires off an AJAX submit and sets a value in the backing bean. However in the above case the value is always false (verified by debug) and then check box then gets unchecked when it is reRendered.

              To get it to work we have to expand any other branch and then click the checkbox.

              Here is the tree code:

              <a4j:outputPanel id="a4jTreeRegion" ajaxRendered="false">
              <rich:tree id="marketSegmentTree"
              switchType="ajax"
              showConnectingLines="false"
              immediate="true">
              <rich:treeNodesAdaptor id="ms" nodes="#{searchAction.marketSegments}" var="marketSegment">
              <rich:treeNode ignoreDupResponses="true"
              onexpand="ajax_start();"
              oncomplete="ajax_end();"
              >
              <h:outputText value="#{marketSegment.name}" />
              </rich:treeNode>

              <rich:treeNodesAdaptor id="values" var="value" nodes="#{marketSegment.values}">
              <rich:treeNode ignoreDupResponses="true" onexpand="ajax_start();" oncomplete="ajax_end();">
              <h:selectBooleanCheckbox value="#{value.isCheckBoxClicked}" rendered="#{empty value.values}" immediate="true">
              <a4j:support
              ajaxSingle="true"
              event="onclick"
              reRender="selectOneSegVarType, alert, checkboxAlert"
              onsubmit="ajax_start();"
              oncomplete="ajax_end();"
              action="#{searchAction.handleMarketSegmentsToSearchSummary(null, marketSegment.name, value.name, value.isCheckBoxClicked, value.segmentId)}"
              />
              </h:selectBooleanCheckbox>
              <h:outputText value="#{value.name}" />
              </rich:treeNode>

              <rich:treeNodesAdaptor id="subvalues" var="subvalue" nodes="#{value.values}">
              <rich:treeNode ignoreDupResponses="true" onexpand="ajax_start();" oncomplete="ajax_end();">
              <h:selectBooleanCheckbox title="#{value.name}" value="#{subvalue.isCheckBoxClicked}" immediate="true">
              <a4j:support
              ajaxSingle="true"
              event="onclick"
              reRender="selectOneSegVarType, alert, checkboxAlert"
              onsubmit="ajax_start();"
              oncomplete="ajax_end();"
              action="#{searchAction.handleMarketSegmentsToSearchSummary(marketSegment.name, value.name, subvalue.name, subvalue.isCheckBoxClicked, subvalue.segmentId)}"
              />
              </h:selectBooleanCheckbox>
              <h:outputText value="#{subvalue.name}" />
              </rich:treeNode>
              </rich:treeNodesAdaptor>

              </rich:treeNodesAdaptor>
              </rich:treeNodesAdaptor>
              </rich:tree>
              </a4j:outputPanel>


              Any help or advice you could offer would be appreciate. If you need more information such as the AJAX data submitted I will be happy to post it.

              Thanks in advance.

              • 4. Re: rich:tree usage help
                Yevgen Kravchenko Newbie

                Hi

                Has anyone tried to implement tree with multiple selection?

                I've created one. The idea is to use <ajax:support> when user clicks tree node. Then selection is processed on server side (it's implemented in such way cause my tree provides ability to select all child nodes just clicking on parent node), and each node has css defined to it,so when some node is selected it is heighlighted with background color set to gray.

                Still I have issue. Ajax response (generated due to <ajax:support>) returns large data (actually whole tree), so that causes great performance problem. If tree is really big it takes long time to select any node.

                So Could You provide some info/examples/'way to go' for some other implementation of multi select tree?

                Regards Yevgen Kravchenko

                • 5. Re: rich:tree usage help
                  Yevgen Kravchenko Newbie

                  I suppose this thread is dead and _Edward_ wouldn't reply. See discussion here http://jboss.com/index.html?module=bb&op=viewtopic&p=4114539#4114539

                  • 6. Re: rich:tree usage help
                    Nikunj Gohel Newbie

                    Dear Friend,

                     

                    I had mailed you regarding my problem with rich:tree. You might have got mail with the subject "rich:tree reRender problem in chrome." and from "ngohel@argusoft.com". So please read that mail and do the needful.

                     

                    Here i am describing the problem so that anyone else can also help me.

                     

                    I have used rich:tree component in my xhtml file and i want to reRender that component every 5 seconds, that is why i have used a4j:poll to reRender that component.

                     

                    The reRendering works fine in Mozilla Firefox but it does not work in Google Chrome, as tree gets disappeared while reRendering.

                     

                    And then that tree comes only when i refresh the browser.

                     

                    So please help me to solve this problem. I hope for your kindness.

                     

                    Thanks.