How to get treedata correctly

Advertisement
Hi all, i am using apache tomahawk tree2 component and i get the tree item from DB. The code like:
public TreeNode getTreeData() {
          List list = getMenuList();
          TreeNode treeData = new TreeNodeBase("foo-folder", "Inbox", false);
          Iterator it = list.iterator();
          HashMap menuTable = new HashMap();
          while (it.hasNext()) {
               Eosmenu item = (Eosmenu) it.next();
               String label = item.getMenuLabel();
               boolean isLeaf = item.getIsLeaf() != null
                         && item.getIsLeaf().equalsIgnoreCase("Y");
               int level = item.getMenuLevel();
               String menuId = item.getMenuId();
               String parentsID = item.getParentsId();
               TreeNodeBase node = new TreeNodeBase();
               if(isLeaf){
                    node.setType("document");
               }else{
                    node.setType("bar-folder");
               node.setDescription(label);
               node.setLeaf(isLeaf);
               menuTable.put(menuId, node);
               if (level == 1) {
                    treeData.getChildren().add(node);
               } else {
                    TreeNodeBase pItem = (TreeNodeBase) menuTable.get(parentsID);
                    if (pItem != null)
                         pItem.getChildren().add(node);
          return treeData;
     }This works well only when the items are in the front of their chirdren. How to let it works correctly when the data in the database like :
id------menuid-------menuname------menulevel------parentid
1----------b---------------bb-------------------2------------------a
2----------a---------------aa-------------------1------------------0
Advertisement

Replay

anybody help me.

How to get operation/activity number in correct sequence

hi all, in Tcode CA03, we can see the first column "operation number" come in sequence. 0010     INSTRUCT 0020     STAGE 0030     SMT1 0040     SMT2 0050     ROUTING 0060     TEST1 0070     QC 0080     LBLPACK1 0090     FQA-TEST 0100     FINALQA

How to get Chinese string in the database?

Hi,    My dear friends.    I successfully connect the database, the data in the table as shown below   When I try to get "小明", but the following results were obtained Does anyone know why, and how to get the correct result? Thank you.You need to

How to get KTOPL for a given BELNR

Hi all you experts! I am codding a simple report that obtains some data from BSAK including BELNR and SAKNR. I need to show in this report the description of SAKNR. I know that I can get it from table SKAT but in order to do that I need to know SPRAS

How to get the corract accrual for OID: Bonds Premium&Discount amortization

Hi I would like to know if somebody knows how to get the correct accrual values for the OID amounts. As you know is easy to get the correct position flows for the base amount, the discount and the monthly interest for each paid but I cant get the cor

I have just upgraded iTunes to version 11 and now cannot stream via my airport express to my hiFi. I get error 15000. how can this be corrected?

I have just upgraded iTunes to version 11 and now cannot stream via my airport express to my hiFi. I get error 15000. how can this be corrected?You've done great so far to upgrade to Leopard & install more RAM. Now install the 10.5.8 combo update at

How to get Correct curent time and date

Hi, I would like to know whether system keeps updating SY-UZEIT each second or it contains the time value when the program was started. Suppose a program starts at 12:00:00 time and takes 10 sec to finish. Will I get same value of SY-UZEIT or will i

TS3103 I have aol and cannot acesss my email after updating to osx 10.6. the help says that I need mail 4.6. I have 4.5.  How do I get the correct version?

Ihave aol and cannot acesss my email after updating to osx 10.6. the help says that I need mail 4.6. I have 4.5.  How do I get the correct version?Run all software updates. http://support.apple.com/kb/TS4424Read other 2 answers

My name for my icloud is not correct, how do I get it corrected?

My name for my icloud is not correct, how do I get it corrected?The address you create when you sign into icloud for the first time, and checked off "mail" in the icloud preferences cannot be changed. As for setting up an alias, did you setup ic

Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address.  My other devices all have the correct address.  How can I get the correct address for my iPhone?  The only Apple ID that works for logging in is my new one.

Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address.  My other devices all have the correct address.  How can I get the correct address for my iPhone?  The only Apple ID that works for logging in is my new

HT3702 I apparently ordered an Adobe program by mistake.  How do i get it corrected?

I apparently ordered an Adobe program by mistake.  How do I get it corrected?If you bought it from iTunes then try the 'report a problem' link from your purchase history : log into your account on your computer's iTunes via the Store > View My Accoun

How to get CSS to display correctly in IE

I am having a HORRIBLE time getting my site to look right in IE - weird thing is, I have IE7 on a Windows Platform (through parralells on my Mac) and I can get it to look fine, but my client has IE7 - and the logo is always "out of bounds" I am

SRM7 - how to get clipboard content at runtime

Hello gurus, not sure this is the proper section as my question is kinda technical and ABAP-related, anyway.... SRM 7.0 has a Copy/Paste option on items of a document (purchase order or contract): once the user selects an item, the "Copy" button

How to get retro pay in payroll

How to get retro pay in bw.I have the same issue. payslip shows the retro amounts correctly, but i can't figure out how to get the right amount using the data found in the RT table.. one thing i got is, when all retro amounts are added up, less the d

How to get SelectOneChoice value from a af:Table

JDeveloper v11.1.2.4.0 - JSF Greetings, im having a problem getting a column value that is a select one choice object. This is not a common problem since i actually did different thing than others so please follow my problem description and if you ha

How to get the sorted Groups in Adminstration Portal

after adding a Child Group to the parent Group the Child Groups are not sorted.So how to get the sorted list when any child group is added to a parent group.In which class we have to make the changes to get the sorted group.Hi  Manorama, 1) If you ha

How to get apps from iTunes to play on my computer

how to get apps from iTunes to play on my computerThat is correct if there is a similar application made for the computer. It will not be sold through iTunes. Either you get it from the developer's website or look for it in the App Store or look for

TS3999 I had an icloud account setup in 2009 when I first got my family members each a mac. I let that account expire(we never used it) and I don't know how to get it off of my ical. It is not recognizing any of the information to reset the password?

I had an icloud account in 2009. We set it up as a family plan because my family had just changed from PC to Mac. We never used it and let the plan expire in 2010. My ical will not sync with my new iphone because it is linked to the family plan accou

Easy Custom device tool - how to get actual waveforms or data from a channel

I want to use a custom device to do the simulation for my system, but I am not sure how to get channel data to it?  I am using a cRio 9024, and 6 modules for signal input and signal output.  I did the walk through, but it is not connecting to channel

Need help using split, how to get the number of inputs?

I am trying to write a program in which a user inputs several numbers, then the output is how many numbers were input. I am thinking that the best way to do this is to use split, however I am pretty new and can't get it quite down. ThanksSorry, I gue