Alpha Video Training
Results 1 to 11 of 11

Thread: Hierarchical tree which can model Parent-child relationships

  1. #1
    Member
    Real Name
    Robert W. McGaffic
    Join Date
    Mar 2007
    Posts
    577

    Default Hierarchical tree which can model Parent-child relationships

    Alpha's tree control can easily or directly model hierarchical relationships. Alpha can only build a tree based on repeating values for each node of the hierarchical.

    A much more elegant approach is taken by Microsoft's Tree control and even Filemaker. They do not require that the redundant fields be maintained, but instead that a parent record has one or more children, which in turn can have on or more children.

    In other words to model a hierarchy with 10 levels, Alpha requires 10 fields concatenated together, whereas Filemaker's approach only requires the key of the parent record.

    To me, this is very significant weakness in Alpha's design. No matter that the existing control allows only very limited property settings (background color, being one example) compared with commercial third party controls.

    The real deficiency is the contortions developers are forced to do to populate the tree.

    Please Alpha -- fix this design deficiency.

    Bob McGaffic
    Pittsburgh, PA

  2. #2
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,617

    Default Re: Hierarchical tree which can model Parent-child relationships

    *tree_from_dependencies()
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  3. #3
    Member
    Real Name
    Robert W. McGaffic
    Join Date
    Mar 2007
    Posts
    577

    Default Re: Hierarchical tree which can model Parent-child relationships

    Art,

    Thank you for pointing out this functionality; I was not aware of it.

    But this still doesn't have the ease of use I think it should have.

    It assumes a "Data list", rather than working directly from table entries.

    If the Toolbox's tree control can populate a tree directly from a table, wouldn't it be nice if that control could be extended to accomodate hierarchical values read from table entries?

    I just don't think users should have to go to the extra trouble of creating a separate Data List.

    Bob McGaffic
    Pittsburgh

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Hierarchical tree which can model Parent-child relationships

    I just don't think users should have to go to the extra trouble of creating a separate Data List.
    Do you have a sample table? Seems like the data list should just be a properly constructed table.external_record_content_get().
    There can be only one.

  5. #5
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,617

    Default Re: Hierarchical tree which can model Parent-child relationships

    Quote Originally Posted by rmcgaffic View Post
    Art,

    Thank you for pointing out this functionality; I was not aware of it.

    I want to avoid XDialog like the........, and I suspect I am not alone.
    You can call me Al, or you can call me Art, but don't call me late to dinner..

    Xdialog is easy to use when you use the action scripting helper...

    I tried for a long time to avoid xbasic and xdialog, but soon realized how much power and flexibility I was losing...

    Stan is correct about the table.external_record_content_get().

    It's a similar situation to the controls to my car. Sometimes they do too much for me and it's a pain....
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  6. #6
    Member
    Real Name
    Robert W. McGaffic
    Join Date
    Mar 2007
    Posts
    577

    Default Re: Hierarchical tree which can model Parent-child relationships

    Stan,

    Here is the employees database from Microsoft Access Northwind Traders demo.

    Again if you can do what you think is possible, wouldn't it be nice to incorporate both your and Art's suggestion in the Choices tab of the Alpha Tree control? This seems to be exactly what FileMaker Pro does.


    Code:
    Employee ID	Last Name	First Name	Title	Reports To
    1	Davolio	Nancy	Sales Representative	Fuller, Andrew
    2	Fuller	Andrew	Vice President, Sales	
    3	Leverling	Janet	Sales Representative	Fuller, Andrew
    4	Peacock	Margaret	Sales Representative	Fuller, Andrew
    5	Buchanan	Steven	Sales Manager	Fuller, Andrew
    6	Suyama	Michael	Sales Representative	Buchanan, Steven
    7	King	Robert	Sales Representative	Buchanan, Steven
    8	Callahan	Laura	Inside Sales Coordinator	Fuller, Andrew
    9	Dodsworth	Anne	Sales Representative	Buchanan, Steven
    Bob McGaffic
    Pittsburgh

  7. #7
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Hierarchical tree which can model Parent-child relationships

    Didn't have time to get into the Northwind. Don't spend much time wishing for what is not in there when I still have so much to learn about what is.
    There can be only one.

  8. #8
    Member
    Real Name
    Robert W. McGaffic
    Join Date
    Mar 2007
    Posts
    577

    Default Re: Hierarchical tree which can model Parent-child relationships

    Here's my suggestion for the Choices tab to the Tree control providing radio buttons to select one of two ways of populating a tree:

    Code:
    Choices for control are: Computed automatically
    
    Source:  Values from a table/set
    
    From table: <Current table>
    
    (X)  Use parent-child fields to build
    
          Parent field name: XXXXX
    
          Child field name: XXXXX
    
    (X)  Use concatenated fields to build 
    
          Field/expression values to display: XXXXX
    
          Display order: XXXXX
    How simple, how straightforward!

    Bob McGaffic
    Pittsburgh, PA

  9. #9
    Member
    Real Name
    Robert W. McGaffic
    Join Date
    Mar 2007
    Posts
    577

    Default Re: Hierarchical tree which can model Parent-child relationships

    Stan,

    Your file does not look complete. I find only a dbf file not an Alpha Five form.

    Bob McGaffic
    Pittsburgh, PA

    PS Re your comment of spending your time looking at features are already in Alpha Five, have you ever looked at the user defined dockable panel.

    Sorry, but Selwyn's code behind the what's new in Version 9 hurts my brain.

    I can't find any other documentation. There was a single posting by Lance/Keith. When I placed their code behind a form button, nothing happened when the button was clicked. It just shouldn't have to be this hard to understand major advances in Alpha Five functionality.

    Alpha has got to stop plopping in extraordinarily wonderful functionality like this, and provide next to non-existant documentation, let alone examples of graduated complexity that would make learning easier. Why do I think that Ms. Bush and Dr. Wayne wouldn't touch this with a ten foot pole?

  10. #10
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Hierarchical tree which can model Parent-child relationships

    My sample is a simple table (and its support files which contain the form definition). Unzip it somewhere and add the table to your database for examination.

    I did some work later and the sample now includes an xdialog tree and a form tree object which do the same thing.
    There can be only one.

  11. #11
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,437

    Default Re: Hierarchical tree which can model Parent-child relationships

    Robert,

    I saw your comment about dock panels, they are not difficult once you understand the basics of them. They are defined just like a modless dialog box. However you say you tried putting a button on a form to run the code, presumably the clock code I put up, they do not work with forms. They work with MDI Xdialog windows.

    Try looking at the whats new in version 9 in the help, this has a link to this video which gives a basic idea of the capabilities and then look at the second example in the learning xdialog database, this works on the customers table at present, but imagine another dock panel to choose the table, so that changed in the mdi window and the navigation dock panel changed to suit the fields of the new panel.

    I have built several functions that create dock panels (menus, clock, calendar). The menu ones take different formats like acordian, tree etc and with a little work you can create a tree with different numbers of nodes. Jeff's examle here is an excellent example, there are others ways if you look around on here.

    If you want any of my dock panel code just private message me and I will send it, with how to add it to the examples in the learning xdialog database, then the world is your oyster!!

Similar Threads

  1. parent-child
    By cloud in forum Alpha Five Version 8
    Replies: 1
    Last Post: 02-25-2009, 01:45 PM
  2. Parent -> Child -> Parent Data Transfer
    By dik_coleman in forum Alpha Five Version 8
    Replies: 5
    Last Post: 09-27-2007, 11:52 AM
  3. Parent with Child
    By paulyp in forum Alpha Five Version 7
    Replies: 2
    Last Post: 01-06-2006, 09:34 PM
  4. Should -Can- a parent be it's own child?
    By Scott Axton in forum Alpha Five Version 5
    Replies: 4
    Last Post: 09-02-2003, 05:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •