6 Replies Latest reply on Oct 24, 2011 10:00 AM by hhoehn

    Problem with rich:tree and events

    hhoehn

      Hi,

       

      Im using richfaces 3.3.3 and i have problems with events in the rich:tree. I have a tree with 100k emelemts in it and each element have a <a4j:commandlink> which set states in a BackingBean to do other things with the selected element information. But sometimes the tree is hanging and i can't select another element or collapse an tree component....

       

      I see in the a4j log that the request to collapse the tree element will send correctly but the response will not have information about the elements to collapse. How can it be that the a4j request is send but the internal handling will not work. Can the ajax engine have a wrong state? If this state occur, alle events (other menu events to change to a new side also not work) are broken. But this "corrupt" state  always occur by selecting tree elements.

       

      Here are the information about my implementation:

       

      xhtml file:

       

      <a4j:form eventsQueue="WebQueue">

           <rich:tree id="group_tree_id" value="#{GroupTreeBean.treeNode}" stateAdvisor="#{TreeAdvisor}" var="item" switchType="ajax">

                <rich:treeNode iconLeaf="#{item.image}" icon="#{item.image}">

                     <a4j:commandLink reRender="Group_LD_id">

                          <h:outputText value="#{item}" escape="true">

                               <f:converter converterId="UrlConverter" />

                           </h:outputText>

                          <a4j:actionparam name="obid" value="#{item.obid}" assignTo="#{GroupDataBean.obid}"/>

                          <a4j:actionparam name="header" value="#{item.name}" assignTo="#{GroupDataBean.headerTitle}"/>

                     </a4j:commandLink>

                </rich:treeNode>

           </rich:tree>

      </a4j:form>

          

       

       

      a4jLog:

       

      debug[12:47:57,064]: Have Event [object Object] with properties: target: undefined, srcElement: [object], type: click

      debug[12:47:57,074]: Query preparation for form 'j_id122' requested

      debug[12:47:57,083]: Append hidden control j_id122:group_tree_id:input with value [j_id122:group_tree_id:Ie999:Ie14669:Ie14670:Ie14671:Ie14210:Ie14378:Ie14379::j_id123] and value attribute [j_id122:group_tree_id:Ie999:Ie14669:Ie14670:Ie14671:Ie14210:Ie14378:Ie14379::j_id123]

      debug[12:47:57,094]: Append hidden control j_id122 with value [j_id122] and value attribute [j_id122]

      debug[12:47:57,105]: Append hidden control autoScroll with value [] and value attribute []

      debug[12:47:57,110]: Append hidden control javax.faces.ViewState with value [j_id2] and value attribute [j_id2]

      debug[12:47:57,118]: parameter j_id122:group_tree_id:Ie999:Ie7449::j_id123NodeExpanded with value true

      debug[12:47:57,123]: parameter j_id122:group_tree_id:Ie999:Ie7449::j_id123AjaxExpanded with value true

      debug[12:47:57,128]: Look up queue with default name

      debug[12:47:57,136]: NEW AJAX REQUEST !!! with form: j_id122

      debug[12:47:57,146]: Start XmlHttpRequest

      debug[12:47:57,153]: Request state : 1

      debug[12:47:57,158]: QueryString: AJAXREQUEST=tree_region&j_id122%3Agroup_tree_id%3Ainput=j_id122%3Agroup_tree_id%3AIe999%3AIe14669%3AIe14670%3AIe14671%3AIe14210%3AIe14378%3AIe14379%3A%3Aj_id123&j_id122=j_id122&autoScroll=&javax.faces.ViewState=j_id2&j_id122%3Agroup_tree_id%3AIe999%3AIe7449%3A%3Aj_id123NodeExpanded=true&j_id122%3Agroup_tree_id%3AIe999%3AIe7449%3A%3Aj_id123AjaxExpanded=true&

      debug[12:47:57,224]: Request state : 2

      debug[12:47:57,231]: Request state : 3

      debug[12:47:57,237]: Request state : 4

      debug[12:47:57,248]: Request end with state 4

      debug[12:47:57,254]: Response  with content-type: text/xml;charset=UTF-8

      debug[12:47:57,261]: Full response content: <html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><script src="/a4j/g/3_3_3.Finaljquery.js.jsf" type="text/javascript"></script></head><body><div xmlns:rich="http://richfaces.ajax4jsf.org/rich"></div><meta name="Ajax-Update-Ids" content="" /><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id2" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /><meta name="Ajax-Update-Ids" content="" /><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id2" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>

      debug[12:47:57,270]: Header Ajax-Expired not found, search in <meta>

      debug[12:47:57,281]: search for elements by name 'meta'  in element #document

      debug[12:47:57,290]: Find <meta name='Ajax-Update-Ids' content=''>

      debug[12:47:57,296]: Find <meta name='Ajax-Response' content='true'>

      debug[12:47:57,306]: Find <meta name='Ajax-Update-Ids' content=''>

      debug[12:47:57,312]: Find <meta name='Ajax-Response' content='true'>

      debug[12:47:57,319]: Header Ajax-Update-Ids not found, search in <meta>

      debug[12:47:57,325]: search for elements by name 'meta'  in element #document

      debug[12:47:57,332]: Find <meta name='Ajax-Update-Ids' content=''>

      warn[12:47:57,338]: No information in response about elements to replace

      debug[12:47:57,343]: call selectSingleNode for id= org.ajax4jsf.oncomplete

      debug[12:47:57,350]: Processing updates finished, no oncomplete function to call

      debug[12:47:57,355]: call selectSingleNode for id= ajax-view-state

      debug[12:47:57,360]: Hidden JSF state fields:

      debug[12:47:57,367]: Namespace for hidden view-state input fields is undefined

      debug[12:47:57,374]: search for elements by name 'input'  in element span

      debug[12:47:57,382]: Replace value for inputs: 259 by new values: 1

      debug[12:47:57,387]: Input in response: javax.faces.ViewState

      debug[12:47:57,394]: Found same input on page with type: hidden

      debug[12:47:57,401]: Found same input on page with type: hidden

      debug[12:47:57,405]: Found same input on page with type: hidden

      debug[12:47:57,412]: Found same input on page with type: hidden

      debug[12:47:57,417]: Found same input on page with type: hidden

      debug[12:47:57,425]: Found same input on page with type: hidden

      debug[12:47:57,431]: Found same input on page with type: hidden

      debug[12:47:57,439]: Found same input on page with type: hidden

      debug[12:47:57,449]: Found same input on page with type: hidden

      debug[12:47:57,454]: Found same input on page with type: hidden

      debug[12:47:57,461]: Found same input on page with type: hidden

      debug[12:47:57,468]: Found same input on page with type: hidden

      debug[12:47:57,475]: Found same input on page with type: hidden

      debug[12:47:57,480]: Found same input on page with type: hidden

      debug[12:47:57,485]: Found same input on page with type: hidden

      debug[12:47:57,492]: Found same input on page with type: hidden

      debug[12:47:57,498]: Found same input on page with type: hidden

      debug[12:47:57,508]: Found same input on page with type: hidden

      debug[12:47:57,513]: Found same input on page with type: hidden

      debug[12:47:57,521]: Found same input on page with type: hidden

      debug[12:47:57,530]: Found same input on page with type: hidden

      debug[12:47:57,538]: Found same input on page with type: hidden

      debug[12:47:57,543]: Found same input on page with type: hidden

      debug[12:47:57,550]: search for elements by name 'INPUT'  in element span

      debug[12:47:57,554]: Replace value for inputs: 259 by new values: 0

      debug[12:47:57,560]: call selectSingleNode for id= _A4J.AJAX.focus

      debug[12:47:57,568]: No focus information in response

       

      Is therefore a workaround?

       

      Best regards

      Harald