[Bug] Get-UDElement from New-UDGrid elements?

Hi folks
I am trying to create a small tool to update or add records to SQLite database (for a front page dashboard that consists of tiles acting as bookmarks)

I, for the life of me, can’t figure out how to read value from a New-UDTextbox that’s within a grid.

Here’s an example code that represents the problem, any ideas?

New-UDPage -Name 'dashboard_variables'  -Endpoint { 

    New-UDGrid -Title "Test" -Headers @("text","btn") -Properties @("text","btn") -Endpoint {

        @(

            [PSCustomObject]@{

                text = New-UDTextbox -Id "testText" -Value "READ THIS"

                btn = New-UDButton -Text "Get text" -OnClick {

                    Show-UDToast -Message (Get-UDElement -Id "testText").Attributes['value'] -Duration 3000

                }

            }

        ) | Out-UDGridData

    } -FontColor white -BackgroundColor "#4D215732" -NoExport -NoPaging

}

try to remove the space in “read this” and see if that makes a deference.

Looks like a bug with New-UDGrid, works fine with New-UDTable.
End result is the same and I only lose filtering, really. Good enough for me.

Working example:

New-UDTable -Title "Test" -Headers @("text","btn") -Endpoint {

        $Data =  @(

            [PSCustomObject]@{

                text = New-UDTextbox -Id "testText" -Value "READ THIS!!!!"

                btn = New-UDButton -Text "Get text" -OnClick {

                    Show-UDToast -Message (Get-UDElement -Id "testText").Attributes['value'] -Duration 3000

                }

            }

        ) 

        $Data | Out-UDTableData -Property @("text", "btn")

    } -FontColor white -BackgroundColor "#4D215732"

@adam

Do you also see this as a bug? Should @raymix file it on the github repo?

I’m try and reproduce this later but this sounds like a bug. Please file an issue on GitHub.