You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Heribert Hirth (JIRA)" <ji...@apache.org> on 2011/06/03 02:38:48 UTC
[jira] [Created] (WICKET-3764) Ajax behaviors are failing in
stateless pages
Ajax behaviors are failing in stateless pages
---------------------------------------------
Key: WICKET-3764
URL: https://issues.apache.org/jira/browse/WICKET-3764
Project: Wicket
Issue Type: Bug
Components: wicket-core
Affects Versions: 1.5-RC4
Reporter: Heribert Hirth
Stateless ajax behaviors are not working in stateless pages in 1.5-RC4.2. I verified it with the stateless demo project of Martin Grigorov (https://github.com/martin-g/wicket-stateless), when changing the dropdown on the start page an exception is thrown (clicking the increment link causes a similar exception):
org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior with id: 0 on component: [DropDownChoice [Component id = c]]
At first glance the reason may be located in org.apache.wicket.Behaviors.getBehaviorById() which does not create the ID list if missing (getBehaviorsIdList(false) in line 286 instead of getBehaviorsIdList(true)), because this error does not occur when getBehaviorId() was manually called in the page constructor to force creation of the list.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Reopened] (WICKET-3764) Ajax behaviors are failing in
stateless pages
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov reopened WICKET-3764:
-------------------------------------
Assignee: Martin Grigorov (was: Igor Vaynberg)
I'll change later my github project and test it. If everything is OK I'll move it to wicketstuff/core and change the resolution of this ticket.
> Ajax behaviors are failing in stateless pages
> ---------------------------------------------
>
> Key: WICKET-3764
> URL: https://issues.apache.org/jira/browse/WICKET-3764
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.5-RC4
> Reporter: Heribert Hirth
> Assignee: Martin Grigorov
> Attachments: WICKET-3764.patch
>
>
> Stateless ajax behaviors are not working in stateless pages in 1.5-RC4.2. I verified it with the stateless demo project of Martin Grigorov (https://github.com/martin-g/wicket-stateless), when changing the dropdown on the start page an exception is thrown (clicking the increment link causes a similar exception):
> org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior with id: 0 on component: [DropDownChoice [Component id = c]]
> At first glance the reason may be located in org.apache.wicket.Behaviors.getBehaviorById() which does not create the ID list if missing (getBehaviorsIdList(false) in line 286 instead of getBehaviorsIdList(true)), because this error does not occur when getBehaviorId() was manually called in the page constructor to force creation of the list.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-3764) Ajax behaviors are failing in
stateless pages
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13047193#comment-13047193 ]
Martin Grigorov commented on WICKET-3764:
-----------------------------------------
Looking at it I see we already have getStatelessHint(Component) there.
This can be used too.
Let's see...
> Ajax behaviors are failing in stateless pages
> ---------------------------------------------
>
> Key: WICKET-3764
> URL: https://issues.apache.org/jira/browse/WICKET-3764
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.5-RC4
> Reporter: Heribert Hirth
> Assignee: Martin Grigorov
> Attachments: WICKET-3764.patch
>
>
> Stateless ajax behaviors are not working in stateless pages in 1.5-RC4.2. I verified it with the stateless demo project of Martin Grigorov (https://github.com/martin-g/wicket-stateless), when changing the dropdown on the start page an exception is thrown (clicking the increment link causes a similar exception):
> org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior with id: 0 on component: [DropDownChoice [Component id = c]]
> At first glance the reason may be located in org.apache.wicket.Behaviors.getBehaviorById() which does not create the ID list if missing (getBehaviorsIdList(false) in line 286 instead of getBehaviorsIdList(true)), because this error does not occur when getBehaviorId() was manually called in the page constructor to force creation of the list.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (WICKET-3764) Ajax behaviors are failing in
stateless pages
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov reassigned WICKET-3764:
---------------------------------------
Assignee: Igor Vaynberg (was: Martin Grigorov)
> Ajax behaviors are failing in stateless pages
> ---------------------------------------------
>
> Key: WICKET-3764
> URL: https://issues.apache.org/jira/browse/WICKET-3764
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.5-RC4
> Reporter: Heribert Hirth
> Assignee: Igor Vaynberg
> Attachments: WICKET-3764.patch
>
>
> Stateless ajax behaviors are not working in stateless pages in 1.5-RC4.2. I verified it with the stateless demo project of Martin Grigorov (https://github.com/martin-g/wicket-stateless), when changing the dropdown on the start page an exception is thrown (clicking the increment link causes a similar exception):
> org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior with id: 0 on component: [DropDownChoice [Component id = c]]
> At first glance the reason may be located in org.apache.wicket.Behaviors.getBehaviorById() which does not create the ID list if missing (getBehaviorsIdList(false) in line 286 instead of getBehaviorsIdList(true)), because this error does not occur when getBehaviorId() was manually called in the page constructor to force creation of the list.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (WICKET-3764) Ajax behaviors are failing in
stateless pages
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg reassigned WICKET-3764:
-------------------------------------
Assignee: Martin Grigorov
> Ajax behaviors are failing in stateless pages
> ---------------------------------------------
>
> Key: WICKET-3764
> URL: https://issues.apache.org/jira/browse/WICKET-3764
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.5-RC4
> Reporter: Heribert Hirth
> Assignee: Martin Grigorov
>
> Stateless ajax behaviors are not working in stateless pages in 1.5-RC4.2. I verified it with the stateless demo project of Martin Grigorov (https://github.com/martin-g/wicket-stateless), when changing the dropdown on the start page an exception is thrown (clicking the increment link causes a similar exception):
> org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior with id: 0 on component: [DropDownChoice [Component id = c]]
> At first glance the reason may be located in org.apache.wicket.Behaviors.getBehaviorById() which does not create the ID list if missing (getBehaviorsIdList(false) in line 286 instead of getBehaviorsIdList(true)), because this error does not occur when getBehaviorId() was manually called in the page constructor to force creation of the list.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WICKET-3764) Ajax behaviors are failing in
stateless pages
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13047038#comment-13047038 ]
Igor Vaynberg commented on WICKET-3764:
---------------------------------------
i implemented behavior#isstateless fwiw
> Ajax behaviors are failing in stateless pages
> ---------------------------------------------
>
> Key: WICKET-3764
> URL: https://issues.apache.org/jira/browse/WICKET-3764
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.5-RC4
> Reporter: Heribert Hirth
> Assignee: Igor Vaynberg
> Attachments: WICKET-3764.patch
>
>
> Stateless ajax behaviors are not working in stateless pages in 1.5-RC4.2. I verified it with the stateless demo project of Martin Grigorov (https://github.com/martin-g/wicket-stateless), when changing the dropdown on the start page an exception is thrown (clicking the increment link causes a similar exception):
> org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior with id: 0 on component: [DropDownChoice [Component id = c]]
> At first glance the reason may be located in org.apache.wicket.Behaviors.getBehaviorById() which does not create the ID list if missing (getBehaviorsIdList(false) in line 286 instead of getBehaviorsIdList(true)), because this error does not occur when getBehaviorId() was manually called in the page constructor to force creation of the list.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (WICKET-3764) Ajax behaviors are failing in
stateless pages
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg resolved WICKET-3764.
-----------------------------------
Resolution: Won't Fix
the patch defeats the point of optimization and the point of really being stateless. i think the hit by removing this optimization will be too great.
instead, ajax behaviors should call component.getbehaviorid(this) in bind to force the creation of the id when they are added to the component. but that fix is outside of wicket.
i suppose what we can do is provide behavior#isstateless() which can do the above if true, but im not sure of the value...martin if you want to implement isstateless() go ahead but you will still need to tweak your stateless behaviors to override that and return true.
> Ajax behaviors are failing in stateless pages
> ---------------------------------------------
>
> Key: WICKET-3764
> URL: https://issues.apache.org/jira/browse/WICKET-3764
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.5-RC4
> Reporter: Heribert Hirth
> Assignee: Igor Vaynberg
> Attachments: WICKET-3764.patch
>
>
> Stateless ajax behaviors are not working in stateless pages in 1.5-RC4.2. I verified it with the stateless demo project of Martin Grigorov (https://github.com/martin-g/wicket-stateless), when changing the dropdown on the start page an exception is thrown (clicking the increment link causes a similar exception):
> org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior with id: 0 on component: [DropDownChoice [Component id = c]]
> At first glance the reason may be located in org.apache.wicket.Behaviors.getBehaviorById() which does not create the ID list if missing (getBehaviorsIdList(false) in line 286 instead of getBehaviorsIdList(true)), because this error does not occur when getBehaviorId() was manually called in the page constructor to force creation of the list.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (WICKET-3764) Ajax behaviors are failing in
stateless pages
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov resolved WICKET-3764.
-------------------------------------
Resolution: Fixed
Fix Version/s: 1.5-RC5
Using getStatelessHint() works.
All Ajax behaviors provided by Wicket are stateful already.
> Ajax behaviors are failing in stateless pages
> ---------------------------------------------
>
> Key: WICKET-3764
> URL: https://issues.apache.org/jira/browse/WICKET-3764
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.5-RC4
> Reporter: Heribert Hirth
> Assignee: Martin Grigorov
> Fix For: 1.5-RC5
>
> Attachments: WICKET-3764.patch
>
>
> Stateless ajax behaviors are not working in stateless pages in 1.5-RC4.2. I verified it with the stateless demo project of Martin Grigorov (https://github.com/martin-g/wicket-stateless), when changing the dropdown on the start page an exception is thrown (clicking the increment link causes a similar exception):
> org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior with id: 0 on component: [DropDownChoice [Component id = c]]
> At first glance the reason may be located in org.apache.wicket.Behaviors.getBehaviorById() which does not create the ID list if missing (getBehaviorsIdList(false) in line 286 instead of getBehaviorsIdList(true)), because this error does not occur when getBehaviorId() was manually called in the page constructor to force creation of the list.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (WICKET-3764) Ajax behaviors are failing in
stateless pages
Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-3764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov updated WICKET-3764:
------------------------------------
Attachment: WICKET-3764.patch
Here is the proposed patch.
The only needed call is "getBehaviorId(behavior)" in #internalAdd(Behavior). Everything else is optimization.
The drawback is that now we add BehaviorIdList to the data of each component with a behavior, non-lazy.
If this is OK then we just need to regenerate the expected html for few tests.
> Ajax behaviors are failing in stateless pages
> ---------------------------------------------
>
> Key: WICKET-3764
> URL: https://issues.apache.org/jira/browse/WICKET-3764
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.5-RC4
> Reporter: Heribert Hirth
> Assignee: Martin Grigorov
> Attachments: WICKET-3764.patch
>
>
> Stateless ajax behaviors are not working in stateless pages in 1.5-RC4.2. I verified it with the stateless demo project of Martin Grigorov (https://github.com/martin-g/wicket-stateless), when changing the dropdown on the start page an exception is thrown (clicking the increment link causes a similar exception):
> org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior with id: 0 on component: [DropDownChoice [Component id = c]]
> At first glance the reason may be located in org.apache.wicket.Behaviors.getBehaviorById() which does not create the ID list if missing (getBehaviorsIdList(false) in line 286 instead of getBehaviorsIdList(true)), because this error does not occur when getBehaviorId() was manually called in the page constructor to force creation of the list.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira