Help with getting information after closing modal

Product: PowerShell Universal
Version: 3.5.5

Hey, I’d like to get help with an issue I’ve had for a couple of days. So I’ve been trying to have a modal prompt for computer name and then after the user has typed in the name it it will load a new page with it’s information kind of.

I’ve tried a couple of ways already but got none to work.

This is what I got at the moment.

Show-UDModal -Content {
     New-UDTextbox -id "ComputerName"
} -Header {New-UDTypography "Name of computer"} -Footer {
    New-UDButton -Text "Search" -OnClick { 

        $ComputerName = (Get-UDElement -Id 'ComputerName').value 
        Hide-UDModal
        ./ScriptComputerInfo


} 

The “ScriptComputerInfo”

New-UDTypography -Text $ComputerName

Thanks!

Try something like this

Show-UDModal -Content {
     New-UDTextbox -id "ComputerName"
} -Header {New-UDTypography "Name of computer"} -Footer {
    New-UDButton -Text "Search" -OnClick { 

        $ComputerName = (Get-UDElement -Id 'ComputerName').value 
        Hide-UDModal
        Set-UDElement -Id 'computerInfo' -Content { 
            New-UDTypography -Text $ComputerName
        }


} 

New-UDDynamic -Id 'computerInfo' -Content {

}
1 Like

Thanks for the reply. Didn’t work at first but got me on the right track. For me it worked if I changed

New-UDDynamic -Id 'computerInfo' -Content {

}

To

New-UDElement -Tag 'div' -Id 'computerInfo' -Content {
    
}