Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 997773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:05:18+00:00 2026-05-16T07:05:18+00:00

how to generate dynamic tree.properties file from database and pass it to tree structure

  • 0

how to generate dynamic tree.properties file from database and pass it to tree structure of richfaces.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:05:18+00:00Added an answer on May 16, 2026 at 7:05 am

    Nice Link 4 implementing Lucene(Hibernate Search) http://www.amin-mc.blogspot.com/

    Using Example of przemek TreeManager.java

    enter code : public class TreeManager implements Serializable{
    @ManagedProperty(value="#{BuyerServiceBean}")
    BuyerServiceBean buyerServiceBean;
    
    public BuyerServiceBean getBuyerServiceBean() {
        return buyerServiceBean;
    }
    
    public void setBuyerServiceBean(BuyerServiceBean buyerServiceBean) {
        this.buyerServiceBean = buyerServiceBean;
    }
    private TreeNode<String> root = null;
    private String nodeTitle;
    private String selectedCategory;
    
    public TreeManager() {}
    
    public TreeNode getRoot() {
        if (root == null) {
            List<DepartmentMasterDataBean> c = new ArrayList<DepartmentMasterDataBean>();
            c = buyerServiceBean.treeList(0);
            TreeModel tm = null;
            tm = new TreeModel(c);
            root = tm.getRoot();
        }
        return root;
    }
    
    public void processSelection(NodeSelectedEvent event) {
        HtmlTree tree = (HtmlTree) event.getComponent();
        selectedCategory = (String)tree.getRowData();
        String test = tree.getRowKey().toString();
        Integer id = Integer.parseInt(test.substring(test.lastIndexOf(":")+1, test.length()));
        buyerServiceBean.getDepartmentMasterBindBean().setParentdeptid(id);
        setNodeTitle(selectedCategory);
    }
    
    public String getNodeTitle() {
        return nodeTitle;
    }
    
    public void setNodeTitle(String nodeTitle) {
        this.nodeTitle = nodeTitle;
    }
    
    public void setRoot(TreeNode<String> root) {
        this.root = root;
    }
    
    public String getSelectedCategory() {
        return selectedCategory;
    }
    
    public void setSelectedCategory(String selectedCategory) {
        this.selectedCategory = selectedCategory;
    }
    

    }

    TreeModel.java

    enter code here : public class TreeModel {
    
    
    private TreeNode<String> root;
    
    public TreeModel(List<DepartmentMasterDataBean> c) {
        root = new TreeNodeImpl<String>();
        root.setParent(null);
        root.setData("Kategorie");
        createChildren(root, c);
    }
    
    private void createChildren(TreeNode<String> r, List<DepartmentMasterDataBean> ch) {
        for (DepartmentMasterDataBean c : ch) {
            TreeNode<String> nodeImpl = new TreeNodeImpl<String>();
            nodeImpl.setData(c.getDeptname());
            r.addChild(c.getDeptid(), nodeImpl);            
            if (c.getChildren() != null) {
                createChildren(nodeImpl, c.getChildren());
            }
        }
    }
    
    public TreeNode getRoot() {
        return root;
    }
    

    }

    Important method for iteration

    enter code here : public List<DepartmentMasterDataBean> treeList(Integer deptid) {
        List<DepartmentMasterDataBean> dataBeans = new ArrayList<DepartmentMasterDataBean>();
        List<DepartmentMaster> dms = departmentMasterService.getDepartmentList("parentdeptid", Operation_enum.EQ, deptid);
        for (DepartmentMaster departmentMaster : dms) {
            dataBeans.add(_toDepartmentMasterDataBean(departmentMaster));
        }
        return dataBeans;
    }
    
    public DepartmentMasterDataBean _toDepartmentMasterDataBean(DepartmentMaster departmentMaster) {
        DepartmentMasterDataBean dmdb = new DepartmentMasterDataBean();
        List<DepartmentMasterDataBean> list1 = new ArrayList<DepartmentMasterDataBean>();
        dmdb.setDeptid(departmentMaster.getDeptid());
        dmdb.setDeptname(departmentMaster.getDeptname());
        dmdb.setParentdeptid(departmentMaster.getParentdeptid());
        dmdb.setAddress(departmentMaster.getAddress());
        dmdb.setDatentime(departmentMaster.getDatentime());
        dmdb.setPhone(departmentMaster.getPhone());
        List<DepartmentMaster> dms = new ArrayList<DepartmentMaster>();
        dms = departmentMasterService.getDepartmentList("parentdeptid", Operation_enum.EQ, departmentMaster.getDeptid());
        for (DepartmentMaster departmentMaster1 : dms) {
            list1.add(_toDepartmentMasterDataBean(departmentMaster1));
        }
        dmdb.setChildren(list1);
        return dmdb;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I generate dynamic enums that represent integer IDs from my database in a C#
I generate a dynamic assembly with CSharpCodeProvider, from a C# source saved into a
I want to generate a dynamic SQL where clause from a Scala collection, such
I'm looking for a better way to generate dynamic html from php. Before I
I''m using swfobject in joomla and generate dynamic xml's (writing a file) to load
I have the following code which is generating the dynamic tree structure in ul
I am trying to generate dynamic menu according to the user permission given with
I'm looking to generate a dynamic variable such as the following: varnum = rand(100000)
I am trying to generate a dynamic html button in c#,But buttons are being
I am trying to generate a dynamic xml document in CakePHP to output to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.