Pode.Web icon indicating copy to clipboard operation
Pode.Web copied to clipboard

PodeWebRadio - parameter passing

Open eugen257 opened this issue 2 years ago • 2 comments

Hi,

I don't understand how to pass data from PodeWebTextbox to PodeWebRadio.

here is a sample code:

New-PodeWebTextbox -Id 'txtbox' -Name 'Filter' -Type Text -Value '' -AppendText Filter -NoForm
New-PodeWebRadio -Name RGruppen -Options @('1','2','3') -NoForm | Register-PodeWebEvent -Type Change -ScriptBlock {
                    if($WebEvent.Data.RGruppen -eq '1'){
                        if($WebEvent.Data.Filter){
                           $WebEvent.Data.Filter | out-host  ###???
                        }
                    }
}

why inside PodeWebRadio can I only get parameters of PodeWebRadio ? Thanks

eugen257 avatar Oct 11 '22 11:10 eugen257

Hi @eugen257,

At the moment, for events, this isn't possible. An event is solely for the element it's registered for. A feature I have thought about is support for "grouping" or "linking" elements together; in this scenario, when the radio button event is triggered, it knows the radio buttons are apart of a group, and will serialise the group, not just the radio buttons.

Badgerati avatar Oct 11 '22 14:10 Badgerati

Hi @Badgerati,

how can i filter by the content of 'Select' for example by typing in another 'textbox' or how can i organize it?

eugen257 avatar Oct 12 '22 11:10 eugen257