Users

All Posts (4)

avatar

ilazovic

Textbox enable/disable does not work within a stepper

avatar
avatar
avatar

The text box does not get enabled or disabled when we select/unselect the checkbox. Instead, it keeps the initial value (disabled=$true). The same code works fine if not run within a stepper.

            New-UDStepper -Steps {

                # Step 1

                New-UDStep -OnLoad {

                    New-UDElement -tag 'div' -Content { "Move on" }

                } -Label "Step 1 - Go ahead"


                # Step 2

                New-UDStep -DisablePrevious -OnLoad {

                    New-UDStack -Spacing 2 -FullWidth -AlignItems 'baseline' -Content {

                        New-UDCheckBox -Id 'CheckBoxRadio' -Label 'Click to enable or disable radio buttons and text box' -Checked:$false -Disabled:$false -OnChange {

                            $disableRadio = (Get-UDElement -Id 'CheckBoxRadio').Checked -eq $false

                           

                            Set-UDElement -Id 'RadioGroup1' -Properties @{ 'disabled' = $disableRadio }

                            Set-UDElement -Id 'StartTime' -Properties @{ 'disabled' = $disableRadio }

                        }

       

                        New-UDRadioGroup -Id 'RadioGroup1' -Content {

                            New-UDRadio -Label 'Option 1' -Value 'Option 1'

                            New-UDRadio -Label 'Option 2' -Value 'Option 2'

                        } -Value "Option 1" -Disabled:$true

       

                        New-UDTextbox -Id 'StartTime' -Label 'Start time:' -Value '08:00' -Disabled:$true -MaximumLength 5 -type "text" -OnValidate {

                            $elementValue = (Get-UDElement -Id 'StartTime').Value

                            if ($elementValue -notmatch '^([0-1][0-9]|2[0-3]):[0-5][0-9]$')

                            {

                                New-UDValidationResult -ValidationError "Please enter the time correctly (00:00-23:59)"

                            }

                            else

                            {

                                New-UDValidationResult -Valid ""

                            }

                        }

                    }

       

                } -Label "Step 2 - Check if the elements get enabled and disabled"

Cannot enable/disable radio group

avatar
avatar
avatar

I can no longer enable or disable radio group dynamically. The switch Disabled works as expected, i.e. enabling or disabling the radio group initially.

The following code used to work in version 5.6.9 but does not work in 5.6.13. Selecting or deselecting the checkbox does not enable or disable the radio group RadioGroup1.

New-UDCheckBox -Id 'CheckBoxRadio' -Label 'Click to enable or disable radio buttons' -Checked:$false -Disabled:$false -OnChange {

$disableRadio = (Get-UDElement -Id 'CheckBoxRadio').Checked -eq $false

Set-UDElement -Id 'RadioGroup1' -Properties @{ 'disabled' = $disableRadio }

}

New-UDRadioGroup -Id 'RadioGroup1' -Content {

New-UDRadio -Label 'Option 1' -Value 'Option 1'

New-UDRadio -Label 'Option 2' -Value 'Option 2'

} -Value "Option 1" -Disabled:$false

Set-PSUCache -AbsoluteExpirationFromNow does not expire

avatar
avatar
avatar

It’s still there, 2 days later…

Set-PSUCache -AbsoluteExpirationFromNow does not expire

avatar
avatar
avatar

I understand that the following cache variable should expire after 6 minutes.

Set-PSUCache -Key “SavedText1” -Value “Saved text 1” -AbsoluteExpirationFromNow ([TimeSpan]::FromMinutes(6))

However, it is still available 40 minutes later. I can retrieve the value from cache and can also see it on the portal.

KeyPersistentCreatedUpdatedLast ReadExpirationSliding ExpirationAbsolute Expiration Relative To NowSavedText1NoMay 13, 2025 10:05 AMMay 13, 2025 10:14 AMMay 13, 2025 10:41 AM00:06:00Product: PowerShell Universal
Version: 5.5.2

1 - 4 of 4 items