[ 
https://issues.apache.org/jira/browse/TRINIDAD-348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523966
 ] 

Ryan Slack commented on TRINIDAD-348:
-------------------------------------

I have this problem too, and I have discoverd (via tracing with the debugger), 
that the "var" for the root node is not set! 
TreeUtils.setDefaultFocusRowKey(..) relies on CoreTreeTable.getRowKey() to 
return something meaningfull, however it is returning "null". 
getRowKey() uses this line:
    if (iState._currentRowKey == _NULL)
(which I assume uses _NULL instead of "null" for some good reason), and thus 
assumes that _currentRowKey is either _NULL, or a valid key Object. 
However, _currentRowKey gets set to _model.getRowKey(), and _model was earlier 
set to UIXTree.createCollectionModel(..), which takes the ACTUAL TreeModel, and 
does this this:
    model.setRowKey(null); 
So even though I tried to have my TreeModel implementation start with a 
non-null key, it sets it to null.
What's really crazy is the whole point of setDefaultFocusRowKey(..) is "to 
default the focusRowKey to the root node, if it is not set", but UIXTree 
ensures that the place it gets the default from is "null"!!!!!!!

SOLUTION:
I *think* the right place to fix this is in UIXCollection.getRowKey
<    if (iState._currentRowKey == _NULL)
--
>    if (iState._currentRowKey == _NULL || iState._currentRowKey == null)

but this is so very complicated. I need a painkiller.


> binding in treeTable column cause error
> ---------------------------------------
>
>                 Key: TRINIDAD-348
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-348
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.0.1-incubating-core-SNAPSHOT
>         Environment: JBOSS 4.0.5 or Bea Weblogic 8.3 SP6
>            Reporter: Kamil Helman
>
> I've got such code:
>  
> <tr:document xmlns:ui="http://java.sun.com/jsf/facelets";
>  xmlns:h="http://java.sun.com/jsf/html";
>  xmlns:f="http://java.sun.com/jsf/core";
>  xmlns:tr="http://myfaces.apache.org/trinidad";
>  xmlns:trh="http://myfaces.apache.org/trinidad/html";
>  title="Facelets">
>  
>  <tr:form>
>   <tr:treeTable value="#{fasolek.value}" var="node"
>    rowSelection="single">
>    <f:facet name="nodeStamp">
>     <tr:column>
>      <tr:outputText value="#{node.name}"/>
>     </tr:column>
>    </f:facet>
>     <tr:column>
>     <tr:inputText value="#{node.name}" binding="#{node.uiComponenet}"/>
>    </tr:column>
>   </tr:treeTable>
>  </tr:form>
> </tr:document>
>  
> which gives me such error:
>  
> javax.faces.el.PropertyNotFoundException: /test.xhtml @17,72 
> binding="#{node.uiComponenet}": Target Unreachable, identifier 'node' 
> resolved to null 
> com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:72) 
> org.apache.myfaces.application.ApplicationImpl.createComponent(ApplicationImpl.java:449)
>  
> com.sun.facelets.tag.jsf.ComponentHandler.createComponent(ComponentHandler.java:218)
>  com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:135) 
> com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:295)
>  com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:165) 
> com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
>  
> com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:295)
>  com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:165) 
> com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:295)
>  com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:165) 
> com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:295)
>  com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:165) 
> com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49) 
> com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25) 
> com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95) 
> com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:510) 
> com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:553) 
> org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:178)
>  org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384) 
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:138) 
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:327)
>  
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:291)
>  
> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:214)
>  
> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:90)
>  
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>  
> ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to