aspose file tools*
The moose likes JSF and the fly likes How to set the icon for JSF Tree Node in the backing bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How to set the icon for JSF Tree Node in the backing bean" Watch "How to set the icon for JSF Tree Node in the backing bean" New topic
Author

How to set the icon for JSF Tree Node in the backing bean

Vinoth Selvaraj
Greenhorn

Joined: Jun 07, 2006
Posts: 18
Hi,

I am adding the tree nodes dynamically in the prerender method of the backing bean to the JSF Tree. The nodes are getting added successfully but the icon is not visible.

The icons are visible for the nodes that are added to the JSF Tree using the netbeans editor. The following code is added the JSF tag of the tree node for which the icon is visible.

<f:facet name="image">
<webuijsf:image icon="TREE_DOCUMENT" id="image4"/>
</f:facet>

How we can add this facet to the tree node i am creating in the prerender method?

Can you please help me?

Regards
Vinoth Selvaraj
muraliRaj lakkaraju
Greenhorn

Joined: Nov 26, 2008
Posts: 4
Hi Gurus,

I have the same problem too.. the node is added to the Tree but image is missing. My requirement is to enable the user to add TreeNodes dynamically by clicking ADD button and the TreeNodes are added at subsequent levels but how to get the page image besides each added TreeNode.

Any idea.

Thanks in advance,
Murali.
prasad kolla
Greenhorn

Joined: Jul 19, 2008
Posts: 12
i too have a similar problem, I am not able to set the image for the tree nodes. I have tried a lot but no success. Does it ring bells to any one..
can you through some light on it.
muraliRaj lakkaraju
Greenhorn

Joined: Nov 26, 2008
Posts: 4
hi,

how can the tree component in JSF page Fragment be made dynamic depending on the data from the database? I could not be able to execute the page fragment which contains Tree component in it and my requirement is to change it dynamically. I followed the example in this url below

web page

but this is on JSF page, i need this with JSF page fragment. How to do it?
J�r�me Leytier
Greenhorn

Joined: Dec 04, 2008
Posts: 1
hi Murali,

i could help if you provide more information but, according to your first post i could suggest you to put the code of jsf page's render method in a public method called, for example myUpdateMethod(Param p) that you will place in page fragment. Then in jsf page's render method put :

myappsource.xxx.fragmentName myFragment (myappsource.xxx.fragmentName)getBean("myappsource$myFragment");
myFragment.myUpdateMethod(myParamToPerformUpdate);

Hope i understood your problem otherwise tell me more.
muraliRaj lakkaraju
Greenhorn

Joined: Nov 26, 2008
Posts: 4
hello Leytier,

thank you for your reply. I got a new problem with JSF Tree. The Tree worked well until i fixed images for each level of Tree (for each TreeNode at different levels). Now i try to delete the TreeNode (with image) after deleting the TreeNode I am rebuilding the Tree - but the problem is the node which is deleted is still appearing at the same place and when i click it obviously jsf is searching for the deleted node and ends up with null pointer. The question i don't want the deleted Node to be displayed (Tree must dynamically update according the user operations). This problem won't appear when i restart my application server - does the old instance is held at somewhere and the new changes are not updated?? i dont know how to solve it?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set the icon for JSF Tree Node in the backing bean