Tree data load by default w/o a mouse click
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
Tree data load by default w/o a mouse click  XML
Forum Index -> Components
Author Message
hobione


Joined: 18/10/2007 00:00:00
Messages: 10
Offline


Hello. I have been struggling on loading tree data set w/o clicking a mouse gesture. I would like to see my tree's first data set by default when application gets initialized.
Please click this link
http://hobione.wordpress.com/2008/08/25/icefaces-tree-data-load/
to see screen shots for better understanding.

Can anyone help me on this? I love ICEFaces. We are thinking to buy support and training soon.

Thanks
Hobi
http://hobione.wordpress.com

hobione


Joined: 18/10/2007 00:00:00
Messages: 10
Offline


There are couple approaches I have taken and both worked.
1. Using annotation

Code:
 
 @PostConstruct
 public void test() {
         HarvestController harvestController = null;
         harvestController = new HarvestController("atowus", "XXX", "6969");
         TreeSet<Version> versionSet = null;
         try {
             versionSet = harvestController.getVersionsInFolder(Integer.parseInt(packageId), fullPathStr);
         } catch (JCaHarvestException ex) {
             Logger.getLogger(TreeBean.class.getName()).log(Level.SEVERE, null, ex);
         } catch (Exception ex) {
             Logger.getLogger(TreeBean.class.getName()).log(Level.SEVERE, null, ex);
         }
         setTreeSetFileView(versionSet);
     }
 


The @PostConstruct annotated method will be called by the container after the bean has been constructed and before any business methods of the bean are executed.

2. W/o annotation also worked but you have to manually call the method.

Annotation ROCKS!

Thanks
Hobi

 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team