Skip to content

Radio button initial state` #662

@Clifra-Jones

Description

@Clifra-Jones

Describe the Feature

The radio button component doesn't have a way to set which option is selected. This presents an issue when loading form controls based in Data retrieved during page initialization.

Also, there isn't a way so set the initial state of which option is selected.

Possible solutions would be:

Set initial state:
New-PodeWebRadio -Name 'MyRadio' -Options 'Option1', 'Option2', 'Option3' -SelectedOption 'Option1'

Update state:
$Id = $WebEvent.Value['id']
$Data = Get-MyData -Id $id #function to retrieve data
Update-PodeWebRadio -Name 'MyRadio' -SelectedOption $Data.MyRadioOption

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions