You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Rob Decker <ro...@objectsource.org> on 2005/03/24 22:47:42 UTC

tree2 with empty TreeNode as base exception

When I have an empty tree:

 treebacker.getTreeData {
   return new TreeNodeBase("branch", "root", "0", true);
 }

 I get this exception:

[24 Mar 2005 16:42:46,806] ERROR <org.apache.myfaces.el.ValueBindingImpl -> 
ValueBindingImpl.java:457> [Thread-17] -
       Cannot get value for expression '#{treeBacker.treeData}'
javax.faces.el.ReferenceSyntaxException: Cannot convert index to int for base 
com.gsk.scmm.vis.test.TreeBacker and index treeData
       at org.apache.myfaces.el.ELParserHelper.coerceToIntegerWrapper
(ELParserHelper.java:418)
       at org.apache.myfaces.el.ELParserHelper.toIndex(ELParserHelper.java:440)
       at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate
(ELParserHelper.java:541)
       at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
       at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:441)
       at org.apache.myfaces.custom.tree2.UITreeData.getValue(UITreeData.java:229)
       at org.apache.myfaces.custom.tree2.HtmlTreeRenderer.encodeChildren
(HtmlTreeRenderer.java:160)
       at javax.faces.component.UIComponentBase.encodeChildren
(UIComponentBase.java:320)

Can there be a way to say 'There are no items', i.e. a custom message instead?

--
Rob

@objectsource.org


Re: x:tree2 problem - Fixed

Posted by "Roger Lee, NOTiFY" <ro...@notify.co.uk>.
Yes originally nothing was been shown in the JSP.

The rendered HTML only had the < head > < title > showing. Even a heading 
inside a < verbatim > wasn't appearing.

Maybe it was cached earlier version. The populated tree did suddenly appear!

Anyway thanks for all your help and suggestions.

Regards,

Roger


Internet communications are not secure and therefore NOTiFY
does not accept legal responsibility for the contents of this message.
Although NOTiFY operates anti-virus programmes, it does not
accept responsibility for any damage whatsoever that is caused by
viruses being passed.  Any views or opinions presented are solely those
of the author and do not necessarily represent those of NOTiFY.
Replies to this email may be monitored by NOTiFY for operational or
business reasons.


----- Original Message ----- 
From: "Sean Schofield" <se...@gmail.com>
To: "Roger Lee, NOTiFY" <ro...@notify.co.uk>; "MyFaces Discussion" 
<my...@incubator.apache.org>
Sent: Monday, March 28, 2005 2:34 PM
Subject: Re: x:tree2 problem - Fixed


> Roger,
>
> I looked at the code that you sent me offlist.  I'm glad you got
> everything working but your explanation of what solved the problem
> seems a bit odd.   Originally you were reporting a blank page right?
> That is to say, *absolutely* without even a root node right?
>
> As I said earlier that seems to only be possible if the root node is
> null (and yes we should add a warning there.)  Yet your code seemed to
> have created a non-null root node in its call to
> createTreeStructureLoanSelection.  Even if the order in which children
> added affected things, it still wouldn't change the fact that your
> root node is not null.
>
> Actually, I thought of one other situation where your tree could be
> blank.  That would be if there was no visible HTML rendered inside of
> the appropriate facets.  I checked your JSP and you have a facet for
> the "loanHierarchy" type so I don't understand how you could possibly
> have gotten a blank page.  I would have expected an emtpy root folder
> (that couldn't be expanded) at a *minimum.*
>
> Are you sure you didn't experience something like this instead?  If
> not, then possibly you were running off a cached version of the
> component tree or something?
>
> sean
>
>
>
> On Mon, 28 Mar 2005 09:00:27 +0100, Roger Lee, NOTiFY
> <ro...@notify.co.uk> wrote:
>> Sean,
>>
>> After altering the order I constructed the "tree2" it worked!   Added the
>> parents then the children as I went along. Rather than constructing 
>> branches
>> as I went along and adding the completed branch to the parent. If that 
>> makes
>> sense?
>>
>> This is reverse to how I did it in Web Galileo.
>>
>> Feel you could do with some more warning/error messages though as it was
>> fixed more by luck than judgement.
>>
>> Regards,
>>
>> Roger Lee
>>
>> Internet communications are not secure and therefore NOTiFY
>> does not accept legal responsibility for the contents of this message.
>> Although NOTiFY operates anti-virus programmes, it does not
>> accept responsibility for any damage whatsoever that is caused by
>> viruses being passed.  Any views or opinions presented are solely those
>> of the author and do not necessarily represent those of NOTiFY.
>> Replies to this email may be monitored by NOTiFY for operational or
>> business reasons.
>>
>> ----- Original Message -----
>> From: "Sean Schofield" <se...@gmail.com>
>> To: "Roger Lee, NOTiFY" <ro...@notify.co.uk>; "MyFaces Discussion"
>> <my...@incubator.apache.org>
>> Sent: Saturday, March 26, 2005 2:47 PM
>> Subject: Re: x:tree2
>>
>> >I can't think of a reason why your tree wouldn't display.  I still
>> > think the most likely is that the "value" attribute is null b/c this
>> > causes the encodeChildren method to return without warning (something
>> > to be fixed in the future.)  Any other problem and I would expect an
>> > exception thrown somewhere.
>> >
>> > You mentioned that your jsp is identical to tree2.jsp.  How is that
>> > possible?  Tree2.jsp has facets that are specific to the data for that
>> > example.  Unless your data is returning the same values for getType on
>> > the nodes as they are in the examples, this won't work.  I would say
>> > that is the source of your problem but when this happens, you should
>> > get an IllegalArgumentException.
>> >
>> > Why don't you post your code and jsp if you continue to have problems?
>> >
>> > We're still working on the documentation for the components so its
>> > understandable if there is some confusion right now.  :-)
>> >
>> > sean
>> >
>> >
>> > On Fri, 25 Mar 2005 18:01:01 -0000, Roger Lee, NOTiFY
>> > <ro...@notify.co.uk> wrote:
>> >> > Are you assigning a value to the tree using something like <x:tree2
>> >> > value="#{foo}">?  Also the data needs to be wrapped in TreeNodeBase 
>> >> > or
>> >> > your own custom class that implements TreeNode but it sounds like 
>> >> > you
>> >> > are doing that.
>> >>
>> >> Yes my "backer" class does that.  I have also taken the backer class
>> >> (TreeBacker.java) from the examples and used that. Still nothing
>> >> displays.
>> >>
>> >> My JSP is identical to tree2.jsp.
>> >>
>> >> > 1.) Your tree has a rendered attribute of false
>> >>
>> >> Where would this be set?
>> >>
>> >> Regard,
>> >>
>> >> Roger
>> >>
>> >> Internet communications are not secure and therefore NOTiFY
>> >> does not accept legal responsibility for the contents of this message.
>> >> Although NOTiFY operates anti-virus programmes, it does not
>> >> accept responsibility for any damage whatsoever that is caused by
>> >> viruses being passed.  Any views or opinions presented are solely 
>> >> those
>> >> of the author and do not necessarily represent those of NOTiFY.
>> >> Replies to this email may be monitored by NOTiFY for operational or
>> >> business reasons.
>> >>
>> >> ----- Original Message -----
>> >> From: "Sean Schofield" <se...@gmail.com>
>> >> To: "MyFaces Discussion" <my...@incubator.apache.org>; "Roger 
>> >> Lee,
>> >> NOTiFY" <ro...@notify.co.uk>
>> >> Sent: Friday, March 25, 2005 2:08 PM
>> >> Subject: Re: x:tree2
>> >>
>> >> > No error messages?  Hmm.  My guess is one of the following:
>> >> >
>> >> > 1.) Your tree has a rendered attribute of false
>> >> > 2.) Your tree has a value of null for its value attribute.
>> >> >
>> >> > Neither of these cases generates a warning in the logs although that
>> >> > might be a good idea?
>> >> >
>> >> > Are you assigning a value to the tree using something like <x:tree2
>> >> > value="#{foo}">?  Also the data needs to be wrapped in TreeNodeBase 
>> >> > or
>> >> > your own custom class that implements TreeNode but it sounds like 
>> >> > you
>> >> > are doing that.
>> >> >
>> >> > sean
>> >> >
>> >> >
>> >> > On Fri, 25 Mar 2005 11:45:44 -0000, Roger Lee, NOTiFY
>> >> > <ro...@notify.co.uk> wrote:
>> >> >> Using the example supplied with MyFaces I am trying to use the 
>> >> >> x:tree2
>> >> >> component.
>> >> >>
>> >> >> I have taken the backing class which I used with Web Galileo and
>> >> >> converted
>> >> >> it to use TreeNode.
>> >> >>
>> >> >> The JSP gets called and my "breakpoints" are displayed in the JBoss
>> >> >> console,
>> >> >> but no Tree is rendered or errors thrown.
>> >> >>
>> >> >> Any pointers to what I should checking/looking for?
>> >> >>
>> >> >> Thanks,
>> >> >>
>> >> >> Roger Lee
>> >> >>
>> >> >>
>> >> >
>> >>
>> >>
>> >
>>
>>
> 



Re: x:tree2 - Example of Action Listener

Posted by "Roger Lee, NOTiFY" <ro...@notify.co.uk>.
Sorted.

Internet communications are not secure and therefore NOTiFY
does not accept legal responsibility for the contents of this message.
Although NOTiFY operates anti-virus programmes, it does not
accept responsibility for any damage whatsoever that is caused by
viruses being passed.  Any views or opinions presented are solely those
of the author and do not necessarily represent those of NOTiFY.  
Replies to this email may be monitored by NOTiFY for operational or 
business reasons.


----- Original Message ----- 
From: "Roger Lee, NOTiFY" <ro...@notify.co.uk>
To: "MyFaces Discussion" <my...@incubator.apache.org>
Sent: Monday, March 28, 2005 3:33 PM
Subject: x:tree2 - Example of Action Listener


> Does anyone have any examples of the Action Listener for tree2?
> 
> Regards,
> 
> Roger Lee
> 
> Internet communications are not secure and therefore NOTiFY
> does not accept legal responsibility for the contents of this message.
> Although NOTiFY operates anti-virus programmes, it does not
> accept responsibility for any damage whatsoever that is caused by
> viruses being passed.  Any views or opinions presented are solely those
> of the author and do not necessarily represent those of NOTiFY.  
> Replies to this email may be monitored by NOTiFY for operational or 
> business reasons.
> 
>


x:tree2 - Example of Action Listener

Posted by "Roger Lee, NOTiFY" <ro...@notify.co.uk>.
Does anyone have any examples of the Action Listener for tree2?

Regards,

Roger Lee

Internet communications are not secure and therefore NOTiFY
does not accept legal responsibility for the contents of this message.
Although NOTiFY operates anti-virus programmes, it does not
accept responsibility for any damage whatsoever that is caused by
viruses being passed.  Any views or opinions presented are solely those
of the author and do not necessarily represent those of NOTiFY.  
Replies to this email may be monitored by NOTiFY for operational or 
business reasons.


Re: x:tree2 problem - Fixed

Posted by Sean Schofield <se...@gmail.com>.
Roger, 

I looked at the code that you sent me offlist.  I'm glad you got
everything working but your explanation of what solved the problem
seems a bit odd.   Originally you were reporting a blank page right? 
That is to say, *absolutely* without even a root node right?

As I said earlier that seems to only be possible if the root node is
null (and yes we should add a warning there.)  Yet your code seemed to
have created a non-null root node in its call to
createTreeStructureLoanSelection.  Even if the order in which children
added affected things, it still wouldn't change the fact that your
root node is not null.

Actually, I thought of one other situation where your tree could be
blank.  That would be if there was no visible HTML rendered inside of
the appropriate facets.  I checked your JSP and you have a facet for
the "loanHierarchy" type so I don't understand how you could possibly
have gotten a blank page.  I would have expected an emtpy root folder
(that couldn't be expanded) at a *minimum.*

Are you sure you didn't experience something like this instead?  If
not, then possibly you were running off a cached version of the
component tree or something?

sean



On Mon, 28 Mar 2005 09:00:27 +0100, Roger Lee, NOTiFY
<ro...@notify.co.uk> wrote:
> Sean,
> 
> After altering the order I constructed the "tree2" it worked!   Added the
> parents then the children as I went along. Rather than constructing branches
> as I went along and adding the completed branch to the parent. If that makes
> sense?
> 
> This is reverse to how I did it in Web Galileo.
> 
> Feel you could do with some more warning/error messages though as it was
> fixed more by luck than judgement.
> 
> Regards,
> 
> Roger Lee
> 
> Internet communications are not secure and therefore NOTiFY
> does not accept legal responsibility for the contents of this message.
> Although NOTiFY operates anti-virus programmes, it does not
> accept responsibility for any damage whatsoever that is caused by
> viruses being passed.  Any views or opinions presented are solely those
> of the author and do not necessarily represent those of NOTiFY.
> Replies to this email may be monitored by NOTiFY for operational or
> business reasons.
> 
> ----- Original Message -----
> From: "Sean Schofield" <se...@gmail.com>
> To: "Roger Lee, NOTiFY" <ro...@notify.co.uk>; "MyFaces Discussion"
> <my...@incubator.apache.org>
> Sent: Saturday, March 26, 2005 2:47 PM
> Subject: Re: x:tree2
> 
> >I can't think of a reason why your tree wouldn't display.  I still
> > think the most likely is that the "value" attribute is null b/c this
> > causes the encodeChildren method to return without warning (something
> > to be fixed in the future.)  Any other problem and I would expect an
> > exception thrown somewhere.
> >
> > You mentioned that your jsp is identical to tree2.jsp.  How is that
> > possible?  Tree2.jsp has facets that are specific to the data for that
> > example.  Unless your data is returning the same values for getType on
> > the nodes as they are in the examples, this won't work.  I would say
> > that is the source of your problem but when this happens, you should
> > get an IllegalArgumentException.
> >
> > Why don't you post your code and jsp if you continue to have problems?
> >
> > We're still working on the documentation for the components so its
> > understandable if there is some confusion right now.  :-)
> >
> > sean
> >
> >
> > On Fri, 25 Mar 2005 18:01:01 -0000, Roger Lee, NOTiFY
> > <ro...@notify.co.uk> wrote:
> >> > Are you assigning a value to the tree using something like <x:tree2
> >> > value="#{foo}">?  Also the data needs to be wrapped in TreeNodeBase or
> >> > your own custom class that implements TreeNode but it sounds like you
> >> > are doing that.
> >>
> >> Yes my "backer" class does that.  I have also taken the backer class
> >> (TreeBacker.java) from the examples and used that. Still nothing
> >> displays.
> >>
> >> My JSP is identical to tree2.jsp.
> >>
> >> > 1.) Your tree has a rendered attribute of false
> >>
> >> Where would this be set?
> >>
> >> Regard,
> >>
> >> Roger
> >>
> >> Internet communications are not secure and therefore NOTiFY
> >> does not accept legal responsibility for the contents of this message.
> >> Although NOTiFY operates anti-virus programmes, it does not
> >> accept responsibility for any damage whatsoever that is caused by
> >> viruses being passed.  Any views or opinions presented are solely those
> >> of the author and do not necessarily represent those of NOTiFY.
> >> Replies to this email may be monitored by NOTiFY for operational or
> >> business reasons.
> >>
> >> ----- Original Message -----
> >> From: "Sean Schofield" <se...@gmail.com>
> >> To: "MyFaces Discussion" <my...@incubator.apache.org>; "Roger Lee,
> >> NOTiFY" <ro...@notify.co.uk>
> >> Sent: Friday, March 25, 2005 2:08 PM
> >> Subject: Re: x:tree2
> >>
> >> > No error messages?  Hmm.  My guess is one of the following:
> >> >
> >> > 1.) Your tree has a rendered attribute of false
> >> > 2.) Your tree has a value of null for its value attribute.
> >> >
> >> > Neither of these cases generates a warning in the logs although that
> >> > might be a good idea?
> >> >
> >> > Are you assigning a value to the tree using something like <x:tree2
> >> > value="#{foo}">?  Also the data needs to be wrapped in TreeNodeBase or
> >> > your own custom class that implements TreeNode but it sounds like you
> >> > are doing that.
> >> >
> >> > sean
> >> >
> >> >
> >> > On Fri, 25 Mar 2005 11:45:44 -0000, Roger Lee, NOTiFY
> >> > <ro...@notify.co.uk> wrote:
> >> >> Using the example supplied with MyFaces I am trying to use the x:tree2
> >> >> component.
> >> >>
> >> >> I have taken the backing class which I used with Web Galileo and
> >> >> converted
> >> >> it to use TreeNode.
> >> >>
> >> >> The JSP gets called and my "breakpoints" are displayed in the JBoss
> >> >> console,
> >> >> but no Tree is rendered or errors thrown.
> >> >>
> >> >> Any pointers to what I should checking/looking for?
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Roger Lee
> >> >>
> >> >>
> >> >
> >>
> >>
> >
> 
>

Re: x:tree2 problem - Fixed

Posted by "Roger Lee, NOTiFY" <ro...@notify.co.uk>.
Sean,

After altering the order I constructed the "tree2" it worked!   Added the 
parents then the children as I went along. Rather than constructing branches 
as I went along and adding the completed branch to the parent. If that makes 
sense?

This is reverse to how I did it in Web Galileo.

Feel you could do with some more warning/error messages though as it was 
fixed more by luck than judgement.

Regards,

Roger Lee

Internet communications are not secure and therefore NOTiFY
does not accept legal responsibility for the contents of this message.
Although NOTiFY operates anti-virus programmes, it does not
accept responsibility for any damage whatsoever that is caused by
viruses being passed.  Any views or opinions presented are solely those
of the author and do not necessarily represent those of NOTiFY.
Replies to this email may be monitored by NOTiFY for operational or
business reasons.


----- Original Message ----- 
From: "Sean Schofield" <se...@gmail.com>
To: "Roger Lee, NOTiFY" <ro...@notify.co.uk>; "MyFaces Discussion" 
<my...@incubator.apache.org>
Sent: Saturday, March 26, 2005 2:47 PM
Subject: Re: x:tree2


>I can't think of a reason why your tree wouldn't display.  I still
> think the most likely is that the "value" attribute is null b/c this
> causes the encodeChildren method to return without warning (something
> to be fixed in the future.)  Any other problem and I would expect an
> exception thrown somewhere.
>
> You mentioned that your jsp is identical to tree2.jsp.  How is that
> possible?  Tree2.jsp has facets that are specific to the data for that
> example.  Unless your data is returning the same values for getType on
> the nodes as they are in the examples, this won't work.  I would say
> that is the source of your problem but when this happens, you should
> get an IllegalArgumentException.
>
> Why don't you post your code and jsp if you continue to have problems?
>
> We're still working on the documentation for the components so its
> understandable if there is some confusion right now.  :-)
>
> sean
>
>
> On Fri, 25 Mar 2005 18:01:01 -0000, Roger Lee, NOTiFY
> <ro...@notify.co.uk> wrote:
>> > Are you assigning a value to the tree using something like <x:tree2
>> > value="#{foo}">?  Also the data needs to be wrapped in TreeNodeBase or
>> > your own custom class that implements TreeNode but it sounds like you
>> > are doing that.
>>
>> Yes my "backer" class does that.  I have also taken the backer class
>> (TreeBacker.java) from the examples and used that. Still nothing 
>> displays.
>>
>> My JSP is identical to tree2.jsp.
>>
>> > 1.) Your tree has a rendered attribute of false
>>
>> Where would this be set?
>>
>> Regard,
>>
>> Roger
>>
>> Internet communications are not secure and therefore NOTiFY
>> does not accept legal responsibility for the contents of this message.
>> Although NOTiFY operates anti-virus programmes, it does not
>> accept responsibility for any damage whatsoever that is caused by
>> viruses being passed.  Any views or opinions presented are solely those
>> of the author and do not necessarily represent those of NOTiFY.
>> Replies to this email may be monitored by NOTiFY for operational or
>> business reasons.
>>
>> ----- Original Message -----
>> From: "Sean Schofield" <se...@gmail.com>
>> To: "MyFaces Discussion" <my...@incubator.apache.org>; "Roger Lee,
>> NOTiFY" <ro...@notify.co.uk>
>> Sent: Friday, March 25, 2005 2:08 PM
>> Subject: Re: x:tree2
>>
>> > No error messages?  Hmm.  My guess is one of the following:
>> >
>> > 1.) Your tree has a rendered attribute of false
>> > 2.) Your tree has a value of null for its value attribute.
>> >
>> > Neither of these cases generates a warning in the logs although that
>> > might be a good idea?
>> >
>> > Are you assigning a value to the tree using something like <x:tree2
>> > value="#{foo}">?  Also the data needs to be wrapped in TreeNodeBase or
>> > your own custom class that implements TreeNode but it sounds like you
>> > are doing that.
>> >
>> > sean
>> >
>> >
>> > On Fri, 25 Mar 2005 11:45:44 -0000, Roger Lee, NOTiFY
>> > <ro...@notify.co.uk> wrote:
>> >> Using the example supplied with MyFaces I am trying to use the x:tree2
>> >> component.
>> >>
>> >> I have taken the backing class which I used with Web Galileo and
>> >> converted
>> >> it to use TreeNode.
>> >>
>> >> The JSP gets called and my "breakpoints" are displayed in the JBoss
>> >> console,
>> >> but no Tree is rendered or errors thrown.
>> >>
>> >> Any pointers to what I should checking/looking for?
>> >>
>> >> Thanks,
>> >>
>> >> Roger Lee
>> >>
>> >>
>> >
>>
>>
> 



Re: x:tree2

Posted by Sean Schofield <se...@gmail.com>.
I can't think of a reason why your tree wouldn't display.  I still
think the most likely is that the "value" attribute is null b/c this
causes the encodeChildren method to return without warning (something
to be fixed in the future.)  Any other problem and I would expect an
exception thrown somewhere.

You mentioned that your jsp is identical to tree2.jsp.  How is that
possible?  Tree2.jsp has facets that are specific to the data for that
example.  Unless your data is returning the same values for getType on
the nodes as they are in the examples, this won't work.  I would say
that is the source of your problem but when this happens, you should
get an IllegalArgumentException.

Why don't you post your code and jsp if you continue to have problems?

We're still working on the documentation for the components so its
understandable if there is some confusion right now.  :-)

sean


On Fri, 25 Mar 2005 18:01:01 -0000, Roger Lee, NOTiFY
<ro...@notify.co.uk> wrote:
> > Are you assigning a value to the tree using something like <x:tree2
> > value="#{foo}">?  Also the data needs to be wrapped in TreeNodeBase or
> > your own custom class that implements TreeNode but it sounds like you
> > are doing that.
> 
> Yes my "backer" class does that.  I have also taken the backer class
> (TreeBacker.java) from the examples and used that. Still nothing displays.
> 
> My JSP is identical to tree2.jsp.
> 
> > 1.) Your tree has a rendered attribute of false
> 
> Where would this be set?
> 
> Regard,
> 
> Roger
> 
> Internet communications are not secure and therefore NOTiFY
> does not accept legal responsibility for the contents of this message.
> Although NOTiFY operates anti-virus programmes, it does not
> accept responsibility for any damage whatsoever that is caused by
> viruses being passed.  Any views or opinions presented are solely those
> of the author and do not necessarily represent those of NOTiFY.
> Replies to this email may be monitored by NOTiFY for operational or
> business reasons.
> 
> ----- Original Message -----
> From: "Sean Schofield" <se...@gmail.com>
> To: "MyFaces Discussion" <my...@incubator.apache.org>; "Roger Lee,
> NOTiFY" <ro...@notify.co.uk>
> Sent: Friday, March 25, 2005 2:08 PM
> Subject: Re: x:tree2
> 
> > No error messages?  Hmm.  My guess is one of the following:
> >
> > 1.) Your tree has a rendered attribute of false
> > 2.) Your tree has a value of null for its value attribute.
> >
> > Neither of these cases generates a warning in the logs although that
> > might be a good idea?
> >
> > Are you assigning a value to the tree using something like <x:tree2
> > value="#{foo}">?  Also the data needs to be wrapped in TreeNodeBase or
> > your own custom class that implements TreeNode but it sounds like you
> > are doing that.
> >
> > sean
> >
> >
> > On Fri, 25 Mar 2005 11:45:44 -0000, Roger Lee, NOTiFY
> > <ro...@notify.co.uk> wrote:
> >> Using the example supplied with MyFaces I am trying to use the x:tree2
> >> component.
> >>
> >> I have taken the backing class which I used with Web Galileo and
> >> converted
> >> it to use TreeNode.
> >>
> >> The JSP gets called and my "breakpoints" are displayed in the JBoss
> >> console,
> >> but no Tree is rendered or errors thrown.
> >>
> >> Any pointers to what I should checking/looking for?
> >>
> >> Thanks,
> >>
> >> Roger Lee
> >>
> >>
> >
> 
>

Re: x:tree2

Posted by "Roger Lee, NOTiFY" <ro...@notify.co.uk>.
> Are you assigning a value to the tree using something like <x:tree2
> value="#{foo}">?  Also the data needs to be wrapped in TreeNodeBase or
> your own custom class that implements TreeNode but it sounds like you
> are doing that.

Yes my "backer" class does that.  I have also taken the backer class
(TreeBacker.java) from the examples and used that. Still nothing displays.

My JSP is identical to tree2.jsp.

> 1.) Your tree has a rendered attribute of false

Where would this be set?

Regard,

Roger


Internet communications are not secure and therefore NOTiFY
does not accept legal responsibility for the contents of this message.
Although NOTiFY operates anti-virus programmes, it does not
accept responsibility for any damage whatsoever that is caused by
viruses being passed.  Any views or opinions presented are solely those
of the author and do not necessarily represent those of NOTiFY.
Replies to this email may be monitored by NOTiFY for operational or
business reasons.


----- Original Message ----- 
From: "Sean Schofield" <se...@gmail.com>
To: "MyFaces Discussion" <my...@incubator.apache.org>; "Roger Lee, 
NOTiFY" <ro...@notify.co.uk>
Sent: Friday, March 25, 2005 2:08 PM
Subject: Re: x:tree2


> No error messages?  Hmm.  My guess is one of the following:
>
> 1.) Your tree has a rendered attribute of false
> 2.) Your tree has a value of null for its value attribute.
>
> Neither of these cases generates a warning in the logs although that
> might be a good idea?
>
> Are you assigning a value to the tree using something like <x:tree2
> value="#{foo}">?  Also the data needs to be wrapped in TreeNodeBase or
> your own custom class that implements TreeNode but it sounds like you
> are doing that.
>
> sean
>
>
> On Fri, 25 Mar 2005 11:45:44 -0000, Roger Lee, NOTiFY
> <ro...@notify.co.uk> wrote:
>> Using the example supplied with MyFaces I am trying to use the x:tree2
>> component.
>>
>> I have taken the backing class which I used with Web Galileo and 
>> converted
>> it to use TreeNode.
>>
>> The JSP gets called and my "breakpoints" are displayed in the JBoss 
>> console,
>> but no Tree is rendered or errors thrown.
>>
>> Any pointers to what I should checking/looking for?
>>
>> Thanks,
>>
>> Roger Lee
>>
>>
> 



Re: x:tree2

Posted by Sean Schofield <se...@gmail.com>.
No error messages?  Hmm.  My guess is one of the following:

1.) Your tree has a rendered attribute of false
2.) Your tree has a value of null for its value attribute.

Neither of these cases generates a warning in the logs although that
might be a good idea?

Are you assigning a value to the tree using something like <x:tree2
value="#{foo}">?  Also the data needs to be wrapped in TreeNodeBase or
your own custom class that implements TreeNode but it sounds like you
are doing that.

sean


On Fri, 25 Mar 2005 11:45:44 -0000, Roger Lee, NOTiFY
<ro...@notify.co.uk> wrote:
> Using the example supplied with MyFaces I am trying to use the x:tree2
> component.
> 
> I have taken the backing class which I used with Web Galileo and converted
> it to use TreeNode.
> 
> The JSP gets called and my "breakpoints" are displayed in the JBoss console,
> but no Tree is rendered or errors thrown.
> 
> Any pointers to what I should checking/looking for?
> 
> Thanks,
> 
> Roger Lee
> 
>

x:tree2

Posted by "Roger Lee, NOTiFY" <ro...@notify.co.uk>.
Using the example supplied with MyFaces I am trying to use the x:tree2 
component.

I have taken the backing class which I used with Web Galileo and converted 
it to use TreeNode.

The JSP gets called and my "breakpoints" are displayed in the JBoss console, 
but no Tree is rendered or errors thrown.

Any pointers to what I should checking/looking for?

Thanks,

Roger Lee 



Re: tree2 with empty TreeNode as base exception

Posted by Rob Decker <ro...@objectsource.org>.
Yes, if TreeNode (the value returned by treeBacker.treeData) implements List
you get this exception.

----- Original Message ----- 
From: "Sean Schofield" <se...@gmail.com>
To: "MyFaces Discussion" <my...@incubator.apache.org>
Sent: Friday, March 25, 2005 9:20 AM
Subject: Re: tree2 with empty TreeNode as base exception


> Rob, did you figure this one out yet?
>
> sean
>
>
> On Thu, 24 Mar 2005 16:47:42 -0500, Rob Decker <ro...@objectsource.org>
wrote:
> >
> > When I have an empty tree:
> >
> > treebacker.getTreeData {
> >   return new TreeNodeBase("branch", "root", "0", true);
> > }
> >
> > I get this exception:
> >
> > [24 Mar 2005 16:42:46,806] ERROR
<org.apache.myfaces.el.ValueBindingImpl ->
> > ValueBindingImpl.java:457> [Thread-17] -
> >       Cannot get value for expression '#{treeBacker.treeData}'
> > javax.faces.el.ReferenceSyntaxException: Cannot convert index to int for
base
> > com.gsk.scmm.vis.test.TreeBacker and index treeData
> >       at org.apache.myfaces.el.ELParserHelper.coerceToIntegerWrapper
> > (ELParserHelper.java:418)
> >       at
org.apache.myfaces.el.ELParserHelper.toIndex(ELParserHelper.java:440)
> >       at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate
> > (ELParserHelper.java:541)
> >       at
org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
> >       at
org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:441)
> >       at
org.apache.myfaces.custom.tree2.UITreeData.getValue(UITreeData.java:229)
> >       at org.apache.myfaces.custom.tree2.HtmlTreeRenderer.encodeChildren
> > (HtmlTreeRenderer.java:160)
> >       at javax.faces.component.UIComponentBase.encodeChildren
> > (UIComponentBase.java:320)
> >
> > Can there be a way to say 'There are no items', i.e. a custom message
instead?
> >
> > --
> > Rob
> >
> > @objectsource.org
> >
> >


Re: tree2 with empty TreeNode as base exception

Posted by Sean Schofield <se...@gmail.com>.
Rob, did you figure this one out yet?  

sean


On Thu, 24 Mar 2005 16:47:42 -0500, Rob Decker <ro...@objectsource.org> wrote:
> 
> When I have an empty tree:
> 
> treebacker.getTreeData {
>   return new TreeNodeBase("branch", "root", "0", true);
> }
> 
> I get this exception:
> 
> [24 Mar 2005 16:42:46,806] ERROR <org.apache.myfaces.el.ValueBindingImpl ->
> ValueBindingImpl.java:457> [Thread-17] -
>       Cannot get value for expression '#{treeBacker.treeData}'
> javax.faces.el.ReferenceSyntaxException: Cannot convert index to int for base
> com.gsk.scmm.vis.test.TreeBacker and index treeData
>       at org.apache.myfaces.el.ELParserHelper.coerceToIntegerWrapper
> (ELParserHelper.java:418)
>       at org.apache.myfaces.el.ELParserHelper.toIndex(ELParserHelper.java:440)
>       at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate
> (ELParserHelper.java:541)
>       at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
>       at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:441)
>       at org.apache.myfaces.custom.tree2.UITreeData.getValue(UITreeData.java:229)
>       at org.apache.myfaces.custom.tree2.HtmlTreeRenderer.encodeChildren
> (HtmlTreeRenderer.java:160)
>       at javax.faces.component.UIComponentBase.encodeChildren
> (UIComponentBase.java:320)
> 
> Can there be a way to say 'There are no items', i.e. a custom message instead?
> 
> --
> Rob
> 
> @objectsource.org
> 
>

navigating from tree2

Posted by "Roger Lee, NOTiFY" <ro...@notify.co.uk>.
My ActionListener in a tree2 component calls a backing class and gets the 
Description from the Tree Node.

LoanSelectionTree.jsp

<x:commandLink immediate="true" styleClass="document" 
actionListener="#{loanSelectionTreeActionListener.selectLoan}" >


I then call a method in this Backing Class which returns "success".

 public void selectLoan(ActionEvent actionEvent) throws 
AbortProcessingException {
        //System.out.println("********** LoanSelectionTreeActionListener 
selectLoan");

        UIComponent component = actionEvent.getComponent();

        UIComponent parent = component.getParent().getParent();

        HtmlTree tree = (HtmlTree) parent;
        TreeNode node = tree.getNode();
        nodeDescription = node.getDescription();

        System.out.println(">>>>> LoanSelectionTreeActionListener selectLoan 
node.getDescription = " + node.getDescription());

        // To force return of "Success"
        isTreeNodeSelected();
    }

    public String getNodeDescription() {
        return (nodeDescription);
    }

    public String isTreeNodeSelected() {

        if (nodeDescription != null) {
            System.out.println(">>>>> LoanSelectionTreeActionListener 
isTreeNodeSelected = " + FortyTwoObjectsConstants.SUCCESS_OUTCOME);
            return FortyTwoObjectsConstants.SUCCESS_OUTCOME;
        }
        else {
            System.out.println(">>>>> LoanSelectionTreeActionListener 
isTreeNodeSelected = " + FortyTwoObjectsConstants.ERROR_OUTCOME);
            return FortyTwoObjectsConstants.ERROR_OUTCOME;
        }
    }

in my Faces-Config I have;

<navigation-rule>
        <from-view-id>/LoanSelectionTree.jsp</from-view-id>
        <navigation-case>
            <from-action>#{loanSelectionTreeActionListener.selectLoan}</from-action>
            <from-outcome>success</from-outcome>
            <to-view-id>/LoanEnquirySummary.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>

I have also tried it with;

         <from-action>#{loanSelectionTreeActionListener.isTreeNodeSelected}</from-action>

Either way it does not navigate to my "LoanEnquirySummary.jsp"

No errors thrown. Any suggestions?

Many thanks.

Roger Lee

Internet communications are not secure and therefore NOTiFY
does not accept legal responsibility for the contents of this message.
Although NOTiFY operates anti-virus programmes, it does not
accept responsibility for any damage whatsoever that is caused by
viruses being passed.  Any views or opinions presented are solely those
of the author and do not necessarily represent those of NOTiFY.
Replies to this email may be monitored by NOTiFY for operational or
business reasons.



Re: Getting Description from tree Node

Posted by Rob Decker <ro...@objectsource.org>.
Actually it should be

UIComponent parent = component.getParent();
while (!(parent instanceof HtmlTree))
    parent = parent.getParent();


----- Original Message ----- 
From: "Rob Decker" <ro...@objectsource.org>
To: "MyFaces Discussion" <my...@incubator.apache.org>; "Roger Lee,
NOTiFY" <ro...@notify.co.uk>
Sent: Monday, March 28, 2005 6:38 PM
Subject: Re: Getting Description from tree Node


> UIComponent parent = null;
> while (!(parent instanceof HTMLTree))
>     parent = component.getParent();
>
> HtmlTree tree = (HtmlTree)parent;
>
>
> ----- Original Message ----- 
> From: "Roger Lee, NOTiFY" <ro...@notify.co.uk>
> To: "MyFaces Discussion" <my...@incubator.apache.org>
> Sent: Monday, March 28, 2005 5:07 PM
> Subject: Getting Description from tree Node
>
>
> >
> > I have an ActionListener on a x:commandLink on a Document in a tree2. In
> the
> > backing class I have;
> >
> >   public void selectLoan(ActionEvent actionEvent) throws
> > AbortProcessingException {
> >         UIComponent component = actionEvent.getComponent();
> >
> >         HtmlTree tree = (HtmlTree) component.getParent().getParent;
> >  }
> >
> > But I get a ClassCastException.
> >
> > What is the correct way to get the description from the Tree2 node.
> >
> > Thanks,
> >
> > Roger Lee
> >
> >
> > Internet communications are not secure and therefore NOTiFY
> > does not accept legal responsibility for the contents of this message.
> > Although NOTiFY operates anti-virus programmes, it does not
> > accept responsibility for any damage whatsoever that is caused by
> > viruses being passed.  Any views or opinions presented are solely those
> > of the author and do not necessarily represent those of NOTiFY.
> > Replies to this email may be monitored by NOTiFY for operational or
> > business reasons.
> >
> >
>


Re: Getting Description from tree Node

Posted by "Roger Lee, NOTiFY" <ro...@notify.co.uk>.
Rob,

I now realise that my ClassCastException was due to using;

import org.apache.myfaces.custom.tree.HtmlTree;

not

import org.apache.myfaces.custom.tree2.HtmlTree;

You did mean HtmlTree (not HTMLTree).

When I run you example I just get a continuous loop, as it appears not to be 
finding an instance of HtmlTree.

Have I misunderstood something?

Thanks,

Roger Lee


Internet communications are not secure and therefore NOTiFY
does not accept legal responsibility for the contents of this message.
Although NOTiFY operates anti-virus programmes, it does not
accept responsibility for any damage whatsoever that is caused by
viruses being passed.  Any views or opinions presented are solely those
of the author and do not necessarily represent those of NOTiFY.
Replies to this email may be monitored by NOTiFY for operational or
business reasons.


----- Original Message ----- 
From: "Rob Decker" <ro...@objectsource.org>
To: "MyFaces Discussion" <my...@incubator.apache.org>; "Roger Lee, 
NOTiFY" <ro...@notify.co.uk>
Sent: Tuesday, March 29, 2005 12:38 AM
Subject: Re: Getting Description from tree Node


> UIComponent parent = null;
> while (!(parent instanceof HTMLTree))
>    parent = component.getParent();
>
> HtmlTree tree = (HtmlTree)parent;
>
>
> ----- Original Message ----- 
> From: "Roger Lee, NOTiFY" <ro...@notify.co.uk>
> To: "MyFaces Discussion" <my...@incubator.apache.org>
> Sent: Monday, March 28, 2005 5:07 PM
> Subject: Getting Description from tree Node
>
>
>>
>> I have an ActionListener on a x:commandLink on a Document in a tree2. In
> the
>> backing class I have;
>>
>>   public void selectLoan(ActionEvent actionEvent) throws
>> AbortProcessingException {
>>         UIComponent component = actionEvent.getComponent();
>>
>>         HtmlTree tree = (HtmlTree) component.getParent().getParent;
>>  }
>>
>> But I get a ClassCastException.
>>
>> What is the correct way to get the description from the Tree2 node.
>>
>> Thanks,
>>
>> Roger Lee
>>
>>
>> Internet communications are not secure and therefore NOTiFY
>> does not accept legal responsibility for the contents of this message.
>> Although NOTiFY operates anti-virus programmes, it does not
>> accept responsibility for any damage whatsoever that is caused by
>> viruses being passed.  Any views or opinions presented are solely those
>> of the author and do not necessarily represent those of NOTiFY.
>> Replies to this email may be monitored by NOTiFY for operational or
>> business reasons.
>>
>>
>
> 



Re: Getting Description from tree Node - Code Snippet

Posted by "Roger Lee, NOTiFY" <ro...@notify.co.uk>.
Just in case anyone is interested;

import javax.faces.component.UIComponent;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;

public class LoanSelectionTreeActionListener {

    public LoanSelectionTreeActionListener() {
    }

    public void selectLoan(ActionEvent actionEvent) throws 
AbortProcessingException {
        System.out.println("********** LoanSelectionTreeActionListener 
selectLoan");

        UIComponent component = actionEvent.getComponent();

        UIComponent  parent = component.getParent().getParent();

        HtmlTree tree = (HtmlTree) parent;
        TreeNode node = tree.getNode();

        System.out.println("********** LoanSelectionTreeActionListener 
selectLoan node = " + node.getDescription());
    }
}


Internet communications are not secure and therefore NOTiFY
does not accept legal responsibility for the contents of this message.
Although NOTiFY operates anti-virus programmes, it does not
accept responsibility for any damage whatsoever that is caused by
viruses being passed.  Any views or opinions presented are solely those
of the author and do not necessarily represent those of NOTiFY.
Replies to this email may be monitored by NOTiFY for operational or
business reasons.


----- Original Message ----- 
From: "Rob Decker" <ro...@objectsource.org>
To: "MyFaces Discussion" <my...@incubator.apache.org>; "Roger Lee, 
NOTiFY" <ro...@notify.co.uk>
Sent: Tuesday, March 29, 2005 12:38 AM
Subject: Re: Getting Description from tree Node


> UIComponent parent = null;
> while (!(parent instanceof HTMLTree))
>    parent = component.getParent();
>
> HtmlTree tree = (HtmlTree)parent;
>
>
> ----- Original Message ----- 
> From: "Roger Lee, NOTiFY" <ro...@notify.co.uk>
> To: "MyFaces Discussion" <my...@incubator.apache.org>
> Sent: Monday, March 28, 2005 5:07 PM
> Subject: Getting Description from tree Node
>
>
>>
>> I have an ActionListener on a x:commandLink on a Document in a tree2. In
> the
>> backing class I have;
>>
>>   public void selectLoan(ActionEvent actionEvent) throws
>> AbortProcessingException {
>>         UIComponent component = actionEvent.getComponent();
>>
>>         HtmlTree tree = (HtmlTree) component.getParent().getParent;
>>  }
>>
>> But I get a ClassCastException.
>>
>> What is the correct way to get the description from the Tree2 node.
>>
>> Thanks,
>>
>> Roger Lee
>>
>>
>> Internet communications are not secure and therefore NOTiFY
>> does not accept legal responsibility for the contents of this message.
>> Although NOTiFY operates anti-virus programmes, it does not
>> accept responsibility for any damage whatsoever that is caused by
>> viruses being passed.  Any views or opinions presented are solely those
>> of the author and do not necessarily represent those of NOTiFY.
>> Replies to this email may be monitored by NOTiFY for operational or
>> business reasons.
>>
>>
>
> 



Re: Getting Description from tree Node

Posted by Rob Decker <ro...@objectsource.org>.
UIComponent parent = null;
while (!(parent instanceof HTMLTree))
    parent = component.getParent();

HtmlTree tree = (HtmlTree)parent;


----- Original Message ----- 
From: "Roger Lee, NOTiFY" <ro...@notify.co.uk>
To: "MyFaces Discussion" <my...@incubator.apache.org>
Sent: Monday, March 28, 2005 5:07 PM
Subject: Getting Description from tree Node


>
> I have an ActionListener on a x:commandLink on a Document in a tree2. In
the
> backing class I have;
>
>   public void selectLoan(ActionEvent actionEvent) throws
> AbortProcessingException {
>         UIComponent component = actionEvent.getComponent();
>
>         HtmlTree tree = (HtmlTree) component.getParent().getParent;
>  }
>
> But I get a ClassCastException.
>
> What is the correct way to get the description from the Tree2 node.
>
> Thanks,
>
> Roger Lee
>
>
> Internet communications are not secure and therefore NOTiFY
> does not accept legal responsibility for the contents of this message.
> Although NOTiFY operates anti-virus programmes, it does not
> accept responsibility for any damage whatsoever that is caused by
> viruses being passed.  Any views or opinions presented are solely those
> of the author and do not necessarily represent those of NOTiFY.
> Replies to this email may be monitored by NOTiFY for operational or
> business reasons.
>
>


Getting Description from tree Node

Posted by "Roger Lee, NOTiFY" <ro...@notify.co.uk>.
I have an ActionListener on a x:commandLink on a Document in a tree2. In the 
backing class I have;

  public void selectLoan(ActionEvent actionEvent) throws 
AbortProcessingException {
        UIComponent component = actionEvent.getComponent();

        HtmlTree tree = (HtmlTree) component.getParent().getParent;
 }

But I get a ClassCastException.

What is the correct way to get the description from the Tree2 node.

Thanks,

Roger Lee


Internet communications are not secure and therefore NOTiFY
does not accept legal responsibility for the contents of this message.
Although NOTiFY operates anti-virus programmes, it does not
accept responsibility for any damage whatsoever that is caused by
viruses being passed.  Any views or opinions presented are solely those
of the author and do not necessarily represent those of NOTiFY.
Replies to this email may be monitored by NOTiFY for operational or
business reasons.