Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-UDElement doesn't work on New-UDCheckBox #1368

Closed
b-sarrazin opened this issue Dec 12, 2019 · 2 comments
Closed

Set-UDElement doesn't work on New-UDCheckBox #1368

b-sarrazin opened this issue Dec 12, 2019 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@b-sarrazin
Copy link

b-sarrazin commented Dec 12, 2019

Describe the Issue

Set-UDElement doesn't work on CheckBox.
Doesn’t look like New-UDCheckbox has implemented “Set-UDElement” functionality as of now.
It’s not implemented on New-UDSelect either.

To Reproduce

Make a choice in the Select, the OnChange event is triggered and the switch works properly but the checkboxes are never updated …

Script Sample

New-UDCheckBox -Id "Intranet" -Label $Cache:ADGroupIntranet.Name -Checked -OnChange { }
New-UDCheckBox -Id "IwsUsers" -Label $Cache:ADGroupIWSUsers.Name -Checked -OnChange { }
New-UDSelect -Id "EmployeeIDSelect" -Label "Utilisateur" -Option {
New-UDSelectOption -Name "sans matricule connu" -Value "NEWMAT"
New-UDSelectOption -Name "avec matricule" -Value "Saisir le matricule"
New-UDSelectOption -Name "externe" -Value "EXTERN"
} -OnChange {
switch ((Get-UDElement -Id "EmployeeIDSelect").Attributes["value"]) {
"NEWMAT" {
Remove-UDElement -Id "EmployeeID"
Set-UDElement -Id "Intranet" -Attributes @{
checked = $true
}
Set-UDElement -Id "IwsUsers" -Attributes @{
checked = $true
}
}
"EXTERN" {
Remove-UDElement -Id "EmployeeID"
Set-UDElement -Id "Intranet" -Attributes @{
checked = $false
}
Set-UDElement -Id "IwsUsers" -Attributes @{
checked = $false
}
}
Default {
Add-UDElement -ParentId "EmployeeIDColumn" -Content {
New-UDTextbox -Id "EmployeeID" -Placeholder "Matricule"
}
Set-UDElement -Id "Intranet" -Attributes @{
checked = $true
}
Set-UDElement -Id "IwsUsers" -Attributes @{
checked = $true
}
}
}
}

Version Information

  • Operating System: Windows 10 1909 or Windows Server 2019
  • PowerShell Version: 5.1
  • Universal Dashboard Version: 2.7.0
  • UD Hosting Method: Powershell, IIS
@b-sarrazin b-sarrazin added the bug Something isn't working label Dec 12, 2019
@b-sarrazin b-sarrazin changed the title Set-UDElement doesn't work on CheckBox Set-UDElement doesn't work on New-UDCheckBox and New-UDSelect Dec 12, 2019
@augiaugi
Copy link
Contributor

BoSen29 pushed a commit to BoSen29/universal-dashboard that referenced this issue Dec 20, 2019
adamdriscoll pushed a commit that referenced this issue Dec 20, 2019
@adamdriscoll adamdriscoll changed the title Set-UDElement doesn't work on New-UDCheckBox and New-UDSelect Set-UDElement doesn't work on New-UDCheckBox Dec 20, 2019
@adamdriscoll
Copy link
Member

adamdriscoll commented Dec 20, 2019

Created a new issue to track New-UDSelect - #1402

This issue has been resolved.

@adamdriscoll adamdriscoll added this to the 2.8.2 milestone Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants