Get ID of current element

Product: PowerShell Universal
Version: 4.4.0/5.4.0

Hello internet :slight_smile:
I trying to create a simple (at least at first look) page with some elements (projects reports with their statuses)

I thought it will be easy and it was at first try, i have data in csv (i read them sequentially), I display them , make some manipulation (add menu item,add report item, delete ,move , change color of project icon etc), and with UDDynamic refresh it was fine
But it was working fine with few entries , like up to 10 maybe 15 it was usable.
But when i added more data (around 50) it was painfully slow, every action was 2-3 delay.

So i ended up using nested UDElements. Each Report (project) element has child elements (report links) and all visual elements (like UDPaper, UDIcon, UDmenu) are wrapped inside those child elements. All elements share the same variable in ID (like $n_element, $n_paper,$n_icon,$n_menu) etc.
And it works very fast even with 50 or more entries. I can add element to parent element , delete element from parent element and its almost instant.
But there is one issue with added element. when I add new element its showing up. But i cannot make any action related to this new element because the code is not aware of which element ID is pressed.
I hope i described in understandable.
So to the main question . When i press icon (id of the icon shares the same variable as main element) how to read current ID of that component ?

I can’t answer that, but I used a workaround for a similar issue.

When I create my table data, I add a column named “id” that I fill with (new-guid) in each row.
When creating additional elements in a row, I base the element id on that field.

This way I have a relation between each data row and all element ids in that table row.

I managed to more or less do it using that approach
Its working i dont know how (there so many dynamic variables that are dependent on another dynamic variable) but its working
But i only managed to do basic functionality like add,remove elements.
I do not wanted to mess up with more complicated stuff,cause it will probably break whole thing

Anyway still i will be very glad if i can read id of current element with onclik handler.
I thought that i can use $Evendata internal variable for this.
But most of the components do not not expose such variable. And even if udemenu what im using in my app does, it only returns name od child menu that’s selected

So @adam is currently any way to pass id of selected (with onclick or onchanged block) component to Evendata variable ?
If its not possible, could it be added ?
I can make a feature request if its necessary ?

It’s not possible at the moment. We could certainly pass that in. Please feel free to open a feature request.

done