I have been using 2.3 and was excited seeing Adams post about release 2.6.
But i get errors using a page with a checkbox. The code example was from docs i believe.
ps: 5.1 .net: 4.7.2 UD: 2.6
Code:
$dashboard = New-UDDashboard -Content {
New-UDElement -Id “CheckboxState” -Tag “span”
New-UDCheckbox -Id CheckBox -Label “Check me” -OnChange {
$Element = Get-UDElement -Id CheckBox
Set-UDElement -Id “CheckboxState” -Content $Element
}
Thanks @itfranck I saw this whilst having a smoke outside, so only had the iphone to hand to try and tackle this issue. So sitting here with my laptop that is still not running 2.6.0 looking at the poshud site and the checkbox showing the checked state has the following CSS in the before state:-
Hopefully this will solve your issue, or check and see if this is in the default theme…is it just the default theme you guys have tried this in? I get a feeling it’s css as in FIREFOX it displays the toast when I tick the box, just no tick mark, but that is controlled by CSS on what it shows inside, and the css setting i just pasted is that setting. I really hope this works keep me posted. Peace
From a display only perspective the checkbox on 2.6.0 is working for me. The issue is thought the New-UDInputField is always returning a string type rather than a boolean type for checkbox field. See issue 1095.
Using an UDElement container and Sync-Element, you can flip the checked state based on a session variable.
That being said, session variable are kind of broken in 2.6 (I also opened a bug a few days earlier) so you’d have to put them in a cache variable and manage individual sessions.