Temporary behaviors break behavior id:s
---------------------------------------
Key: WICKET-2141
URL: https://issues.apache.org/jira/browse/WICKET-2141
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 1.4-RC2
Reporter: Martin Makundi
Priority: Minor
Temporary behaviors break behavior id:s:
component.add(temporarybehavior);
component.add(permanentbehavior);
results in: java.lang.IllegalStateException: No behavior listener found with
behaviorId 1; Component: [MarkupContainer [Component id = ajaxUpdate]]
at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:95)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1188)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1265)
Reason: The behaviors are named according to their indexes. When the temporary
behavior is detached, the permanent behavior's id points to index 1 which does
not exist anymore.
Workaround:
always add your temporary behaviors LAST so they will not affect the permanent
behaviors' indexes.
What is really strange:
The WicketTester JUnit test works with no problems, but if you try the attached
quickstart with your browser, the textfield onblur event crashes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.