Daniel
July 29, 2022, 3:48pm
1
Product: PowerShell Universal
Version: 3.1.4
I have a Problem with new-udselect -multiple
New-UDSelect -Option {
New-UDSelectOption -Name "VerfahrenAllgemein" -Value 0
foreach ($i in $Session:Schaltzentrale.VerfahrenServer) {
New-UDSelectOption -Name $i.Servername -Value $i.ID
}
} -Id "SelectBoxEinmalAufwandBestandServer" -Label "Auswahl Server oder Allgemein" -FullWidth -DefaultValue "0" -Multiple
This is the Code.
With -Multiple i get:
Without:
and the confusing error message:
Error rendering component (mu-select)
Error: MUI: The value prop must be an array when using the Select component with multiple.
Whats wrong?
The Code hasnt change since the last 100 Versions and worked fine.
Daniel
July 29, 2022, 5:50pm
2
I am confused.
another Part:
New-UDSelect -Option {
if ($Session:Schaltzentrale.KalkulationServer.count -eq '0') { New-UDSelectOption -Name "Keine" -Value '-1' }
else { New-UDSelectOption -Name "Alle" -Value '0' }
foreach ($i in $Session:Schaltzentrale.KalkulationServer) {
New-UDSelectOption -Name $i.Servername -Value "$($i.ID)"
}
} -Id "BetriebLDIVerfahrenKalkulationSelectBoxServer" -Label "Auswahl Server oder Alle" -FullWidth -Multiple -DefaultValue "0"
with -DefaultValue:
without:
with the same Error:
Error rendering component (mu-select)
Error: MUI: The `value` prop must be an array when using the `Select` component with `multiple`.
Daniel
July 29, 2022, 5:54pm
3
At the same time this code is still working:
New-UDSelect -Option {
foreach ($i in $Session:Schaltzentrale.DataVerfahrenStatus) {
New-UDSelectOption -Name $i.Status -Value $i.ID
}
} -Id "BetriebLDIVerfahrenKalkulationSelectBoxStatus" -Label "Status: mehrfachwahl möglich" -OnChange {
$Bodyvalue = $Body | ConvertFrom-Json
$Session:Schaltzentrale.KalkulationServer = @()
$Session:Schaltzentrale.KalkulationServer += $Session:Schaltzentrale.VerfahrenServer.Where( { $_.StatusID -in $Bodyvalue })
Sync-UDElement -Id "BetriebLDIVerfahrenKalkulationSelectBoxServerDyn"
} -FullWidth -DefaultValue $ErsteAuswahl.ID -Multiple
with Multiple and DefaultValue ???