You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by sp...@indiana.edu on 2005/10/10 16:24:50 UTC

Customize icons in Myfaces tree

Hi,

  I am looking to customize icons in Myfaces tree. I believe we can use
IconProvider in the tree for this task. How do we use the
IconTagProvider to do this. Anyhelp is greatly appreciated.

Thankyou,
Suba.

Re: Customize icons in Myfaces tree

Posted by sp...@indiana.edu.
To customize, we just have implement the IconProvider interface. It works. 

Do u know how to programmatically create output component .

When I click the node of a tree(not tree2), I need to display a output text box
with some stringvalue.
I am dynamically able to create a output text in the valuechanged method. How
should I display it.
If I use panelgrid, I am getting error.
Please, let me know where I going wrong.
Heres my code.
 public void valueChanged(TreeSelectionEvent event){
        System.out.println("There is a new event");
        
            TreePath p = event.getNewSelectionPath();
                 if (p != null)
                 {
                         MyLeadTreeNode adpNode =   
(MyLeadTreeNode)p.getLastPathComponent();
                         System.out.println("inside valuechanged"+ adpNode);  
                         System.out.println("checking"+
adpNode.getNodeDescription());
                         this.descOutputText=adpNode.getNodeDescription();
                         System.out.println("Title"+descOutputText);
                 //        a =(String)descOutputText.getValue();
                    // a=descOutputText;
                 //setdescOutputText(a);
                 Application application =
FacesContext.getCurrentInstance().getApplication();
                 HtmlOutputText output =
(HtmlOutputText)application.createComponent(HtmlOutputText.COMPONENT_TYPE);
                 List children = panel.getChildren();
                 children.clear();
                         output.setValue(descOutputText);
                         System.out.println("getvalue is :" +output.getValue());
                          children.add(output);
                         System.out.println("executed");
                
                
        }
  

 
     public void setPanel(HtmlPanelGrid panel)
    {
            this.panel =panel;
            
    }
    public HtmlPanelGrid getPanel()
    {
            return panel;
    }
}

Thanks,
Suba.


Quoting Sean Schofield <se...@gmail.com>:

> IMO this is easier to do with tree2.  There are plenty of examples to
> show the way if you use this component.  I'm not very amiliar with the
> original tree so I can't help much.  I ran into a lot of problems
> configuring tree which is why I started the tree2.
> 
> sean
> 
> On 10/10/05, speriyas@indiana.edu <sp...@indiana.edu> wrote:
> > Hi,
> >
> >   I am looking to customize icons in Myfaces tree. I believe we can use
> > IconProvider in the tree for this task. How do we use the
> > IconTagProvider to do this. Anyhelp is greatly appreciated.
> >
> > Thankyou,
> > Suba.
> >
> 



Re: Customize icons in Myfaces tree

Posted by Sean Schofield <se...@gmail.com>.
IMO this is easier to do with tree2.  There are plenty of examples to
show the way if you use this component.  I'm not very amiliar with the
original tree so I can't help much.  I ran into a lot of problems
configuring tree which is why I started the tree2.

sean

On 10/10/05, speriyas@indiana.edu <sp...@indiana.edu> wrote:
> Hi,
>
>   I am looking to customize icons in Myfaces tree. I believe we can use
> IconProvider in the tree for this task. How do we use the
> IconTagProvider to do this. Anyhelp is greatly appreciated.
>
> Thankyou,
> Suba.
>