wicketstuff / core

Wicketstuff-core projects are bundled user contributions for use with Apache Wicket (https://wicket.apache.org/). They are released in step with Wicket releases to make them easy to use.
342 stars 298 forks source link

InMethod TreeGrid doesn't properly react to clicks after opening a closed subtree #513

Open duesenklipper opened 8 years ago

duesenklipper commented 8 years ago

When running e.g. the inmethodgrid-examples, newly-displayed rows after opening a closed subtree do not react to clicks. In the demo, neither selecting such items in "Tree Grid with item selection" nor editing such items in "Editable TreeGrid" works.

Workaround: After manually refreshing (F5) the page, it works for those items. Items that are in other subtrees that get opened later need another refresh to work. This is rather awkward for the users.

I suspect that some JavaScript event handlers do not get properly attached by the AJAX response to the click on the "open subtree" icon. I'm investigating it, but it would be great if someone more familiar with this component could have a look too.

duesenklipper commented 8 years ago

After the Ajax request, the newly visible table rows do not have the onclick-Handler that should be supplied by the AjaxFormSubmitBehavior which is added to each table row by AbstractGrid. I do not yet know why this is, but both in the Chrome debugger and in Firebug I can see that the original table rows have this onclick-handler, the new ones don't.

duesenklipper commented 8 years ago

Interestingly, it seems only to happen in master. The wicket-6.x branch works correctly. Still investigating.

duesenklipper commented 8 years ago

I'm still investigating this. I can see that in the the event handlers are not showing up, but in the full page refresh they are there.

I'm trying to git bisect this, but so far that hasn't taken me anywhere. It looks as if this has never worked in the 7.x branch.

duesenklipper commented 8 years ago

This is related to https://github.com/wicketstuff/wicket1.5-tree/issues/3.

duesenklipper commented 8 years ago

I found a fix for the bug in wicket1.5-tree (https://github.com/wicketstuff/wicket1.5-tree/pull/4). Once that is accepted and merged, inmethod-grid could be updated. I already tried it locally, it works by simply updating that dependency.