Product: PowerShell Universal
Version: 4.1.4
Im not sure if this is a bug or if there is some parameter I’m missing to wait for the sync to complete first but what I am doing is syncing an element and then setting an element afterwards:
New-UDSelect -ID "sel1" -Option {
$E5Cat1 | Foreach-Object {
New-UDSelectOption -Name $_.Name -Value $_.ID
}
} -OnChange {
$Session:query_Cat2 = "SELECT ID, Name FROM Category2 WHERE Category1_Id = $EventData ORDER BY SortOrder"
$Session:Query_Cat3 = $null
Sync-UDElement -Id 'sel2-Dynamic'
Sync-UDElement -Id 'sel3-Dynamic'
start-sleep -Milliseconds 300
Set-UDElement -Id "sel2" -Properties @{ Disabled = $false}
Set-UDElement -Id "sel3" -Properties @{ Disabled = $true}
}
So the behavior should be that Select 2 and 3 are disabled until select 1 has a value, and that value changes the SQL query that is used to dynamically fill the other selects. What I’ve noticed is that unless I put a sleep in there Select 2 flashes to enabled but then back off. Im assuming that means that Sync-UDElement runs in the background.