Dude, you know I am a nice guy so I cooked this up…bearing in mind this is running on UD as New-UDSelect does not have a default parameter, but apart from that this is what I cooked up for you:-
New-UDRow -Columns {
New-UDColumn -Endpoint {
Show-UDModal -Height "450px" -Width "450px" -Content {
New-UDSelect -option {
New-UDSelectOption -name "True" -Value "True"
New-UDSelectOption -name "False" -Value "False"
} -OnChange {
$Session:State = $EventData
#Instead of calling sync-udelement use set-udelement to set the state on the id that actually needs changing as sync seemed to set it in the props not the state
Set-UDElement -id 'Boolean_Buttons' -Attributes @{text = "$Session:State" }
}
} -Footer {
New-UDElement -Tag 'div' -Endpoint {
New-UDButton -Id 'Boolean_Buttons' -Text "$Session:State" -OnClick {
#Show-UDToast -Message "$($sqluery.query)"
Hide-UDModal
}
New-UDButton -Text "Cancel" -OnClick { Hide-UDModal }
} -AutoRefresh
}
}
}
Which should give you as it does for me:-
I hope this answers your question on how to achieve this
P.S @MaCCa I never knew you could do this with the footer so learnt something new myself