Tree2 doesn't require that you put your tree in a form (at least with
MyFaces implementation.)  See the simple tree2 examples.  Try running
those same simple examples with the RI to see if there is a problem.

sean

On 6/2/05, Ihab A.B. Awad <[EMAIL PROTECTED]> wrote:
> Hi there,
> 
> I am using the Tree2 component from MyFaces 1.0.9 with the JSF RI 1.1. To get
> this component in my webapp, I am including commons-validator.jar and
> myfaces-extensions.jar, and nothing else.
> 
> With client side toggling, the component works just fine.
> 
> When I tried server side toggling, I got a NPE, as pasted below. Here is my
> diagnosis of what is happening --
> 
>   - The Tree2 creates a UICommandLink for the navigation link and
>     tries to render it;
> 
>   - The JSF implemementation needs to add a hidden field during rendering;
> 
>   - The JSF implementation tries to find the nearest enclosing UIForm; but
> 
>   - The 'parent' of the created UICommandLink is null, hence a NPE.
> 
> Here is the relevant portion of the stack trace --
> 
> java.lang.NullPointerException
>   com.sun.faces.renderkit.html_basic.CommandLinkRenderer.
>         getHiddenFieldName(CommandLinkRenderer.java:136)
>   com.sun.faces.renderkit.html_basic.CommandLinkRenderer.
>         encodeEnd(CommandLinkRenderer.java:320)
>   javax.faces.component.UIComponentBase.
>         encodeEnd(UIComponentBase.java:712)
>   org.apache.myfaces.custom.tree2.HtmlTreeRenderer.
>         encodeRecursive(HtmlTreeRenderer.java:573)
>   org.apache.myfaces.custom.tree2.HtmlTreeRenderer.
>         encodeNavigation(HtmlTreeRenderer.java:544)
>   org.apache.myfaces.custom.tree2.HtmlTreeRenderer.
>         encodeCurrentNode(HtmlTreeRenderer.java:327)
>   ...
> 
> Is this a known problem? Would it go away if I used MyFaces as my JSF
> implementation? (I would have tried this already, but I am still at an early
> stage in my development and, unfortunately, I have stuff in my app that does
> not work with MyFaces because it is not standards-clean yet.)
> 
> Peace,
> 
> --
> Ihab A.B. Awad <[EMAIL PROTECTED]>
> Snr Scientific Programmer
> Dept of Genetics
>

Reply via email to