Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
8.6.1
-
None
Description
Behavior class says that behavior is not stateless if it is a request listener:
public boolean getStatelessHint(Component component) { if (this instanceof IRequestListener) { // this behavior implements a callback interface, so it cannot be stateless return false; } return true; }
In Behaviors "util" class the stable ID is generated for NOT stateless (i.e. stateful) behaviors:
private void internalAdd(final Behavior behavior) { component.data_add(behavior); if (behavior.getStatelessHint(component) == false) { getBehaviorId(behavior); } }
BUT in AbstractDefaultAjaxBehavior#onBind there is a contradictory piece of code, that generates ID for stateless behaviors:
protected void onBind() { final Component component = getComponent(); component.setOutputMarkupId(true); if (getStatelessHint(component)) { //generate behavior id component.getBehaviorId(this); } }
The AJAX behaviors are always IRequestListener so they are stateful by default (unless the getStatelessHint is overridden).
It does not make sense to me... generate ID for stateful behaviors on the one hand in Behaviors and on the other hand for stateless in AbstractDefaultAjaxBehavior.
I suspect that this could be bug.