Bug #31667

AJAX widgets broken when called inside a loop

Added by Sebastian Kurfuerst over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Should have
Category:
Widgets
Start date:
2011-11-08
Due date:
% Done:

100%

Estimated time:
Has patch:
No

Description

As ViewHelpers are supposed to be stateless they were create once per
RenderingContext and reused whenever the RenderingContext fits.
Some ViewHelpers are not stateless, e.g. AJAX widgets.

AJAX widgets push their WidgetContext into an AjaxWidgetContextHolder
before they get rendered.

As soon as AJAX-WidgetViewHelpers were used multiple times within the
same RenderingContext (widgets in ForViewHelpers for example) differet
widgets share the same ViewHelper containing the same WidgetContext.
Because the WidgetContext contains all statefull information about a
widget, only the last rendered widget gets stored in the ContextHolder.
That makes equal AJAX widgets within a for-loop impossible because
each GUI representation interacts with only the last rendered PHP object.

Also available in: Atom PDF