Table Row Selection Not Working with latest Version

Product: PowerShell Universal
Version: 2.8.2

Hi All,

I’m having some issues with New-UDTable and SelectedRows after updating Powershell Universal to version 2.8.2.
I retrieve the selected rows from the table using a button and Get-UDElement with ‘selectedRows’, this has always worked but after the update fails to do so…

Now when I try to receive the data an error occurs
→ Cannot bind argument to parameter ‘InputObject’ because it is null.
→ Stack Trace:
- Cannot bind argument to parameter ‘InputObject’ because it is null.



Using OnRowSelection doesn’t produce data output as well.


Thank you for your time.

Kind regards.
Frederik

I think it’s because you’re trying to pass an object to Show-UDToast and it requires a string. Either try to pipe $value.selectedRows to Out-String or try to return just one property from your table.

$Data = Get-Service -Name BITS,PowerShellUniversal,WSearch |Select-Object Name, Status
New-UDTable -Id tbl_Results -Data $Data -ShowSelection -OnRowSelection {
    $Rows = $EventData
    Show-UDToast -Message ($($Rows).Name)
    Show-UDToast -Message ($Rows |Out-String)
}
New-UDButton -Text 'Show Rows' -OnClick {
    $Rows = (Get-UDElement -Id tbl_Results).selectedRows
    Show-UDToast -Message ($($Rows).Name)
    Show-UDToast -Message ($Rows |Out-String)
}

Also, you might want to give 2.8.3 nightly a shot. We reverted some code for Get-UDElement that was intended to improve performance but may cause issues like what you are seeing with the table.

this normally makes no difference as to showing content or not :slight_smile: All worked fine like it was before that update.

Will do Adam, Thanks!

I updated to version 2.8.3 yet the problem persists.