Skip to content

Snippet redraw not working with BootstrapRenderer #10

@Mirovsky

Description

@Mirovsky

When used any of BootstrapRenderers, snippet redraw sends the message but actual redraw never happens.

Presenter:

class SimplePresenter extends Nette\Application\UI\Presenter {
    public function createComponentSimpleForm() {
        $form = new Nette\Application\UI\Form();
        $form->setRenderer(new BootstrapRenderer);
        $form->getElementPrototype()->class('ajax');

        $form->addText('text', 'Text');
        $form->addSubmit('submit', 'Submit');

        $form->onSuccess[] = array($this, 'onSuccess');

        return $form;
    }
    public function onSuccess(Nette\Application\UI\Form $form) {
        $form->setValues(array(), TRUE);
        $this->redrawControl('form');
    }
}

Template:

{block content}

    {snippet form}
        {control simpleForm}
    {/snippet}

{/block}

All files are included, $.nette.init() called, other snippets redraws are working.
After commenting out line with $form->setRenderer(...) its works properly. Also when DefaultFormRenderer is used, everything works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions