$EventData variable not working with multiple dynamic regions

Product: PowerShell Universal
Version: 4.1.4

If I have two dynamic regions, the $EventData variable for tables does not work properly.

I have two tables, both inside their own dynamic regions. It seems the dashboard alternates between which table the $EventData variable works from.

I have created a very simple dashboard to show this issue. Here you have a UD-tabs with 2 tabs. Inside these you have 2 tables, in their own dynamic regions.

Both the tables have a button in it, that will display $EventData.

When i start the dashboard, clicking on the button in the first table works. Clicking the button in the second table gives me a ‘cannot bind because it is empty’ error. When I refresh, I am then able to click button in table 2, and table 1 gives me the same error.

If i refresh again ,it goes back to table 1 working and table 2 not.


$Data += @{Status = 'REVIEW PENDING'; test = 'Warning'}
$Data2 += @{Status = 'REVIEW PENDING';test = 'Warning'}


$Columns = @(
    New-UDTableColumn -Property Status -Title "status" -Render {New-UDButton -OnClick {Show-UDToast -Message $EventData.Status}}
    New-UDTableColumn -Property Group -Title Group 
    New-UDTableColumn -Property test -Title test 
)
$Columns2 = @(
    New-UDTableColumn -Property Status -Title "status" -Render {New-UDButton -OnClick {Show-UDToast -Message $EventData.Status}}
    New-UDTableColumn -Property Group -Title Group 
    New-UDTableColumn -Property test -Title test 
)


New-UDTabs -Tabs {
    New-UDTab -Id 'tab1' -Text 'Security Groups' -Content { 
        New-UDPaper -Id 'paper1' -Elevation 0 -Content  { 
            New-UDDynamic -Id 'dynamic1' -Content { 
                New-UDTable -Id 'customColumnsTable' -Data $Data -Columns $Columns
            }
        } 
    }
    New-UDTab -Id 'tab2' -Text 'DL Groups' -Content { 
        New-UDPaper -Id 'paper2' -Elevation 0 -Content  { 
            New-UDDynamic -id 'dynamic2' -Content {
                New-UDTable -Id 'customColumnsTable2' -Data $Data2 -Columns $Columns2
            }
        } 
    }

} -Id 'tabs'

Am I doing something wrong, or is this functionality broken?

This was fixed in version 4.1.7. (Raised a ticket with support as a bug and was addressed)

1 Like