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

New-PodeWebGrid inside New-PodeWebCell not working if in Form

Open ml222 opened this issue 1 year ago • 0 comments

Describe the Bug

Placing a New-PodeWebGrid inside a cell, that belongs to a parent grid, does not work if inside a forms -Content block.

The example below will only show "Hello 1" and "Hello 2" on the page. Also on clicking submit, the browser does not stay on page but is directed to a blank page: computername/pode.web-dynamic/elements/form/form_page_testpage_testform/submit

Steps To Reproduce

    New-PodeWebForm -Name 'TestForm' -ScriptBlock {
        Write-Host "Submitted"
    } -Content @(
        New-PodeWebGrid -Cells @(
            New-PodeWebCell -Content @(
                New-PodeWebText -Value 'Hello 1'
            )
            New-PodeWebCell -Content @(
                New-PodeWebText -Value 'Hello 2'
                New-PodeWebGrid -Cells @(
                    New-PodeWebCell -Content @(
                        New-PodeWebText -Value 'Hello 2.1'
                    )
                    New-PodeWebCell -Content @(
                        New-PodeWebText -Value 'Hello 2.2'
                    )
                )
            )
            New-PodeWebCell -Content @(
                New-PodeWebText -Value 'Hello 3'
            )
        )
    )

Expected Behavior

A grid cell should be able to contain another grid, even when the grid(s) belong to a form.

Platform

  • OS: Windows server 2022
  • Browser: Edge
  • Versions:
    • Pode: 2.10.1
    • Pode.Web: 1.0.0
    • PowerShell: 5.2

Additional Context

This worked fine in 0.83

ml222 avatar Aug 31 '24 23:08 ml222