0 Replies Latest reply on Feb 5, 2013 1:41 PM by saskcivic

    Using a Heiarchical Tree with data that can be grouped

      Hello Forum
      I have been tasked with coming up with a selector for one of our applications that uses a tree. I have built a mock-up using the example provided at Craigs Oracle Stuff (https://sites.google.com/site/craigsoraclestuff/oracle-forms---how-to-s/forms-how-to-create-a-hierachical-tree-form) that subsuitutes our data in the SQL for his, and I have successfully added another loop as the data is located in 3 tables, but have come across a few issues. I have been searching the forums and google, but cannot find anything to solve the issues that I am having. Any help is appreciated. This is being developed in 10g. The data is structured as follows.

      ID, Name
      1, A
      2, B
      3, C

      SubCategory (Level 2)
      ID, Name, CatID
      1, A, 1
      2, B, 1
      3, C, 1

      Codes (Level 3 and beyond?)
      ID SubCatID Description
      1, 1, 'The, quick'
      2, 1, 'The, quick, brown'
      3, 1, 'The, quick, brown, fox, jumps'
      4, 1, 'The, quick, brown, fox, jumps, over, the lazy, dog'
      5, 2, 'Wafting, zephyrs, quickly, vexed, Jumbo'
      6, 2, 'Wafting, zephyrs, quickly'

      As you can see the codes table has a lot of repeating values that are delimited by ',' (commas). I can produce a tree out of the 3 tables but...

      The description in the codes table can be as many as 255 characters. The tree seems to truncate the values around 60 characters. I am not sure what the maximum data lenghts in the tree are, or if the max lengths are limited by the node or the entire tree. Although the Category and Subcategory names can be as much as 120 characters, they are more typically around 25 characters.

      Could this problem be remedied buy deepeing the levels of the tree by grouping the values in the codes table on the comma delimiters? The max number of commas in the description is 9, so that would make the tree up to 11 levels deep. I know how to get the text between the commas, but am unsure how to link the data back to the parent

      Ex. The tree would be

      Thanks for any Assistance

      EDIT: I found the reason that the label of the node is being limited in length. The limit is actually 50char because of this line in Craig's code in the Create_RG function:
      gc_id := Add_Group_Column(rg_id, 'label', CHAR_COLUMN,50);
      I changed the limit to 255 and now all of the data displays.

      Although working now, I would still like to know id there is a way of grouping the data into the tree view, as this would make the tree much more readable.

      Edited by: saskcivic on Feb 5, 2013 7:36 AM