nette / forms

📝 Generating, validating and processing secure forms in PHP. Handy API, fully customizable, server & client side validation and mature design.
https://doc.nette.org/forms
Other
491 stars 147 forks source link

Render groups problems #156

Open aleswita opened 7 years ago

aleswita commented 7 years ago

Description

Nette Forms have two rendering issues with using with groups

1. Can not place control to the specific position

Steps To Reproduce

Expected output (without groups):

protected function createComponentForm(): \Nette\Application\UI\Form {
    $form = new \Nette\Application\UI\Form;

    //$form->addGroup("group1");

    $form->addText("input1", "input1");

    $form->addText("input2", "input2");

    $form->addSubmit("send1", "send1");

    $form->addSubmit("send2", "send2");

    $form->addComponent(new \Nette\Forms\Controls\TextInput("input3"), "input3", "send1");

    return $form;
}

Invalid inputs position (with groups):

protected function createComponentForm(): \Nette\Application\UI\Form {
    $form = new \Nette\Application\UI\Form;

    $form->addGroup("group1");

    $form->addText("input1", "input1");

    $form->addText("input2", "input2");

    $form->addSubmit("send1", "send1");

    $form->addSubmit("send2", "send2");

    $form->addComponent(new \Nette\Forms\Controls\TextInput("input3"), "input3", "send1");

    return $form;
}

2. First control without group rendered on the end of form

Steps To Reproduce

protected function createComponentForm(): \Nette\Application\UI\Form {
    $form = new \Nette\Application\UI\Form;

    $form->addText("input1", "input1");

    $form->addGroup("group1");

    $form->addText("input2", "input2");

    $form->addSubmit("send1", "send1");

    $form->addSubmit("send2", "send2");

    return $form;
}
mabar commented 5 years ago

Seems this is related to #199

markoph commented 1 year ago

Hi, we bumped into this issue. I am just pinging ticket so it doesn't get closed because of inactivity.

dg commented 12 months ago

Groups really do behave this way and there is nothing we can do about it on principle.