Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » TreeBox(Assistance understanding the tie in for LookupCalls and TreeBox)
TreeBox [message #1807421] Wed, 29 May 2019 14:55 Go to next message
James Garringer is currently offline James GarringerFriend
Messages: 4
Registered: May 2019
Junior Member
Hi all and thanks in advance for any advice you may have!

I'm trying to create a hierarchical TreeBox using a Lookup call but I must be missing some fundamental understanding because I can't quite get it to work. To elaborate, my table has three columns of interest. An order number, a part #, and cost. I would like to set up a Lookup call that returns to the TreeBox so that I see the part # as a parent and the amounts and child nodes. Any suggestions?
Re: TreeBox [message #1807492 is a reply to message #1807421] Fri, 31 May 2019 07:05 Go to previous messageGo to next message
Patrick Baenziger is currently offline Patrick BaenzigerFriend
Messages: 96
Registered: September 2011
Member
Hi there and welcome!

If I understand you correctly, you want a TreeBox like this:


  • Part No 1

    • Cost 1
    • Amount 1

  • Part No 2

    • Cost 2
    • Amount 2



To achieve the desired result, your LookupCall needs to return three LookupRows.
The trick to make them hierarchical, is to set the parentKey for the children to be equal to the key of the parent row.
You can use the withParentKey method on the LookupCall to set the parentKey, the key itself is usually set in the LookupRow constructor.
Re: TreeBox [message #1807511 is a reply to message #1807492] Fri, 31 May 2019 14:48 Go to previous messageGo to next message
James Garringer is currently offline James GarringerFriend
Messages: 4
Registered: May 2019
Junior Member
Thank you for the response and apologies but I don't quite follow. To clarify my question some more:

I am using a LookupCallService that extends AbstractSqlLookupService, and this has overridden getConfiguredSqlSelect() that I feed an SQL String to. In the database table that this is set up to query I want to relate two columns in a hierarchical way. For instance part# and cost. Part# is not unique though and occurs multiple times throughout the table and is associated with different costs. I'd like to generate a TreeBox that allows me to see all the costs for one part# like so:



  • part#1

    • cost1
    • cost2

  • part#2

    • cost3



Despite the above example it is unlikely for costs associated to a specific part# to actually be sequential in the database.
Re: TreeBox [message #1807556 is a reply to message #1807511] Mon, 03 June 2019 11:22 Go to previous message
The Maddes is currently offline The MaddesFriend
Messages: 44
Registered: October 2018
Member
Hi James,

i think Patrick was leading the right direction.
As far as i understand, the SQL knows the relation from costX to part#X.

So as a solution i would suggest that you create two columns in your SELECT like
"reference" and "parentreference" and set the values the way you need them.

The rest will be solved by the hierarchical treebox or whatever hierarchical structure you decide.

Hope it helps you out a bit :)

Cheers
Previous Topic:Display Search Form when activating the Page
Next Topic:data transfer from TreeField to the server module
Goto Forum:
  


Current Time: Thu Dec 12 20:39:35 GMT 2024

Powered by FUDForum. Page generated in 0.04146 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top