# Hierarchy Tree Customization

**URL:** <https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [April 28, 2023, 5:19am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010 "2023-04-28T05:19:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Kevin\_Dagapioso](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Dan\_Kevin\_Dagapioso](https://forum.inductiveautomation.com/u/Dan_Kevin_Dagapioso)\
**Post date:** [April 28, 2023, 5:19am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/1 "2023-04-28T05:19:52Z")

</div>

Can you help me on how to create a Hierarchy Tree using template repeater?  
like this:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/4/f4b609bf225dc710fcb21be0affab3928c450843.png)

I'll use that template to create a template repeater

and i want it to be like this (its functionality)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/1/11988a3b9e71f88694f41a645b71e76c92b6e48c.png)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 28, 2023, 6:20am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/2 "2023-04-28T06:20:16Z")

</div>

It's an interesting idea.

Here are a few ideas on how to approach this to get you started:  
• I would use the template repeater in dataset mode.  
• The dataset could contain a Parent Name column, and the presence of a name in this column could control the visibility of the '+/-' button  
• The template itself would be nothing more than the "+/-" button, an image, and a borderless button or a label to get the look you are depicting here.  
• The hierarchical depth could be determined any number of ways, and I could see several approaches that would work to create the tab spacing. The one I would be inclined to try first would be to use a transparent object on the left side of a container with a FlowLayout. The arbitrary base width of the object could be multiplied by the zero indexed hierarchy depth, and the other objects would be naturally pushed to the right as the depth increased.  
• When it comes to collapsibility and expandability, perhaps the template parameters could actually be a filtered dataset, and the master dataset could be a custom property on the template itself. The button text at the time of button press could determine whether or not a group's children in the master dataset are removed from or added to the template parameters before or after the button's sign is switched.

---

<div class="post-metadata">

**Author:** ![Dan\_Kevin\_Dagapioso](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Dan\_Kevin\_Dagapioso](https://forum.inductiveautomation.com/u/Dan_Kevin_Dagapioso)\
**Post date:** [April 28, 2023, 6:24am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/3 "2023-04-28T06:24:03Z")

</div>

can you make me a sample of it? sorry I'm still a newbie on datasets.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 28, 2023, 6:44am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/4 "2023-04-28T06:44:10Z")

</div>

I imagine it will need to look like this:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/7/a731ffc3c8261aad5dee9ed129f28008c94a9057.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/0/20ea87b3c6391a7bf3295e2ce8fdab5f7d4dd091.png)

Custom property on the repeater called Master Dataset to use for filtering collapsed templates out of the repeater:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/7/57220d8a77152bec82af50933470b3c65ed43f10.png)

---

<div class="post-metadata">

**Author:** ![Dan\_Kevin\_Dagapioso](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Dan\_Kevin\_Dagapioso](https://forum.inductiveautomation.com/u/Dan_Kevin_Dagapioso)\
**Post date:** [April 28, 2023, 6:46am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/5 "2023-04-28T06:46:21Z")

</div>

how about the position of when expanding? Will i use gui transform?

---

<div class="post-metadata">

**Author:** ![Dan\_Kevin\_Dagapioso](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Dan\_Kevin\_Dagapioso](https://forum.inductiveautomation.com/u/Dan_Kevin_Dagapioso)\
**Post date:** [April 28, 2023, 6:47am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/6 "2023-04-28T06:47:06Z")

</div>

can you explain the column to me. like the depth?

---

<div class="post-metadata">

**Author:** ![Dan\_Kevin\_Dagapioso](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Dan\_Kevin\_Dagapioso](https://forum.inductiveautomation.com/u/Dan_Kevin_Dagapioso)\
**Post date:** [April 28, 2023, 6:50am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/7 "2023-04-28T06:50:53Z")

</div>

what custom property will I make in the template inside the repeater?

---

<div class="post-metadata">

**Author:** ![Dan\_Kevin\_Dagapioso](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Dan\_Kevin\_Dagapioso](https://forum.inductiveautomation.com/u/Dan_Kevin_Dagapioso)\
**Post date:** [April 28, 2023, 6:51am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/8 "2023-04-28T06:51:39Z")

</div>

my problem is some components have no x and y properties

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 28, 2023, 6:56am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/9 "2023-04-28T06:56:45Z")

</div>

You can edit your posts instead of making 4 different ones in a row.

@justinedwards.jle  
Wouldn't it be easier to use the tree view component and customize it to fit the use case ?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 28, 2023, 7:07am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/10 "2023-04-28T07:07:30Z")

</div>

> [@Dan\_Kevin\_Dagapioso](#):
>
> Will i use gui transform?

> [@Dan\_Kevin\_Dagapioso](#):
>
> explain the column to me. like the depth?

> [@justinedwards.jle](#):
>
> use a transparent object on the left side of a container with a FlowLayout. The arbitrary base width of the object could be multiplied by the zero indexed hierarchy depth,

> [@Dan\_Kevin\_Dagapioso](#):
>
> what custom property will I make in the template inside the repeater?

The custom properties must match the column name, and they will be bound to the component properties themselves to give them their attributes. The label text will be bound to the name property, the imagePath will be bound to... etc

> [@Dan\_Kevin\_Dagapioso](#):
>
> some components have no x and y properties

Off the top of my head, I'm not aware of any component missing this, but in any case, if the FlowLayout approach works, this is probably not something that will need consideration.

> [@pascal.fragnoud](#):
>
> Wouldn't it be easier to use the tree view component and customize it to fit the use case

That was the first thing I asked him:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/8961b33ff023c1715ba0f6911fe5a69717ff2492.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/f/3f997f4420e3ed86457754a48f2b8f9fba25020d.png)

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 28, 2023, 7:13am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/11 "2023-04-28T07:13:38Z")

</div>

> [@justinedwards.jle](#):
>
> That was the first thing I asked him

Ah ! I was surprised you didn't mention it here !

---

<div class="post-metadata">

**Author:** ![Dan\_Kevin\_Dagapioso](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Dan\_Kevin\_Dagapioso](https://forum.inductiveautomation.com/u/Dan_Kevin_Dagapioso)\
**Post date:** [April 28, 2023, 7:24am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/12 "2023-04-28T07:24:56Z")

</div>

where will I use the masterparameters custom properties? Sorry but I'm really a beginner here.

---

<div class="post-metadata">

**Author:** ![Dan\_Kevin\_Dagapioso](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Dan\_Kevin\_Dagapioso](https://forum.inductiveautomation.com/u/Dan_Kevin_Dagapioso)\
**Post date:** [April 28, 2023, 7:25am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/13 "2023-04-28T07:25:34Z")

</div>

sorry I dm him instead of posting publicly first that's why.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 28, 2023, 7:41am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/14 "2023-04-28T07:41:26Z")

</div>

Here is a downloadable example I recently did that takes a master dataset custom property and parses it into template parameters for template repeaters:

> [@Easy Chart-Vision](https://forum.inductiveautomation.com/t/easy-chart-vision/72209/8):
>
> Quick update on this post. The above solution of transforming the easychart component with scripting turned out to be too clunky for practical use. The other problem with the approach was that the save button was saving all of the pens no matter which pens were selected. The OP wanted to post the actual solution here, so it can help anybody else who needs to do something like this. What ended up working was the use of a couple of templates in repeaters with a homemade save button. This is the …

Look this over and familiarize yourself with it.

To start with, get the basics of your template built, and work on getting your text and images to show up properly. One the basics are in place, we can turn or attention to solving problems of indention and collapsibility.

---

<div class="post-metadata">

**Author:** ![Dan\_Kevin\_Dagapioso](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Dan\_Kevin\_Dagapioso](https://forum.inductiveautomation.com/u/Dan_Kevin_Dagapioso)\
**Post date:** [April 28, 2023, 7:41am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/15 "2023-04-28T07:41:36Z")

</div>

also I don't know what is FlowLayout?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 28, 2023, 7:43am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/16 "2023-04-28T07:43:32Z")

</div>

Here is the documentation on that:

[java.awt.FlowLayout](https://docs.oracle.com/javase/8/docs/api/java/awt/FlowLayout.html)

This is just an idea; I'm not sure yet if this is best approach, but we can worry about that later in the development process after templates start showing up in a repeater.

---

<div class="post-metadata">

**Author:** ![Dan\_Kevin\_Dagapioso](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Dan\_Kevin\_Dagapioso](https://forum.inductiveautomation.com/u/Dan_Kevin_Dagapioso)\
**Post date:** [April 28, 2023, 7:46am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/17 "2023-04-28T07:46:44Z")

</div>

I see. Where do I put my script?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 28, 2023, 7:49am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/18 "2023-04-28T07:49:31Z")

</div>

> [@Dan\_Kevin\_Dagapioso](#):
>
> Where do I put my script

Let's back up a step. What's the purpose of this thing?

---

<div class="post-metadata">

**Author:** ![Dan\_Kevin\_Dagapioso](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Dan\_Kevin\_Dagapioso](https://forum.inductiveautomation.com/u/Dan_Kevin_Dagapioso)\
**Post date:** [April 28, 2023, 7:53am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/19 "2023-04-28T07:53:41Z")

</div>

I want to use a hierarchy tree to my assets for my management dashboard.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 28, 2023, 7:55am UTC](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010/20 "2023-04-28T07:55:35Z")

</div>

Your asset information is recorded in a database?

[Next page](https://forum.inductiveautomation.com/t/hierarchy-tree-customization/73010.md?page=2)
