nette/nette — Issue #390: Multiplier breaks AJAX in included Controls
Author: vojtech-dobes
Created: 2011-10-31 11:23:01+00:00
State: open

It is caused by implementation of method `renderSnippets`, specifically line [501](https://github.com/nette/nette/blob/master/Nette/Latte/Macros/UIMacros.php#L501). Components attached via Multiplier are not searched at all, and because of that they cannot be rendered.
I fixed it in my application by direct modification of the `renderSnippets` method - is this suitable solution for pull request?

```php
getPresenter()->getContext()->httpRequest->getQuery();
foreach ($control->getComponents(FALSE, 'Nette\Application\UI\Multiplier') as $multiplier) {
foreach ($httpParams as $param => $signal) {
if ($param == 'do' && Strings::startsWith($signal, $multiplier->getName()) && ($pos = strrpos($signal, '-')) !== FALSE) {
$child = $control->getComponent(substr($signal, 0, $pos));
$child->snippetMode = TRUE;
$child->render();
$child->snippetMode = FALSE;
}
}
}
# https://gist.github.com/1297934
```

Topic on forum: http://forum.nette.org/en/929-2011-10-07-added-nette-application-ui-multiplier#p4012