sebfz1 / wicket-jquery-ui

jQuery UI & Kendo UI integration in Wicket
http://www.7thweb.net/wicket-jquery-ui/
Other
92 stars 58 forks source link

DataTable shows content only once (Wicket 9) #333

Closed mdbergmann closed 2 years ago

mdbergmann commented 3 years ago

Hi.

We have a strange problem with DataTable in Wicket 9.3 and Wicket-Kendo-9.3.1. Though I've tried all versions of Wicket-Kendo down to 9.0.

The issue is that the DataTable shows fine, with all entries it should have, but only when the DataTable is loaded first time. All sub-sequent times, i.e. by navigating elsewhere and coming back to another DataTable (it might be a different one), the DataTable is just empty.

Since this doesn't happen with Wicket-Kendo-8.11.x I'm suspecting this is related to Wicket 9?

mdbergmann commented 3 years ago

That is, once per session. When I logout (as in invalidate the session) it shows again, but once.

mdbergmann commented 3 years ago

A page reload works as well to show the DataTable content once again.

sebfz1 commented 3 years ago

I have the feeling it might related to jQuery 3 as well (#311). I've been recently discussing a solution that might work... I will take care of this as well this weekend (I'm afraid I will not have time before)

mdbergmann commented 3 years ago

That's ok. I'd wish I could help some more with this JavaScript stuff.

sebfz1 commented 3 years ago

I cannot reproduce the issue, maybe I miss some information... Can you please prepare a quickstart that shows the problem?

mdbergmann commented 3 years ago

Weird. I'll try.

mdbergmann commented 3 years ago

I could not reproduce it either in a simplified setup. Fact is though that going back to Wicket 8 it works as expected without any changes to DataTable. It seems that the GET request from the Kendo DataTable is not sent in Wicket 9, or at least only once, sometimes twice, but then only after a page refresh. I will continue to investigate.

mdbergmann commented 2 years ago

Just a followup.

We have tried to replace jQuery 3 with the previous jQuery 2 and it seems to resolve the issue.

There are strange requests:

  1. which is OK https://localhost:8443/main?3-.0-layout-detailPanel-content-form-content-container-datatable&take=10&skip=0&page=1&pageSize=10&_=1635413978290

  2. which return with empty data https://localhost:8443/main?3-1.8-layout-detailPanel-content-form-content-container-datatable&_=1635413978298

Not sure if this gives any hint.

sebfz1 commented 2 years ago

Thanks a lot, Manfred. I'll definitely book a couple of hours this weekend to look into it!

thaitzer commented 2 years ago

Hi guys!

I am sorry if this is the wrong place, but I think it might be related.

I am experiencing a similar issue with MultiSelect (in combination with an onchange behavior).

First click works, but then nothing - even so far, as the field is render as a standard html multi-line select instead of the kendo ui. And "of course" there are no onChange-listeners or anything attached after the reload.

I also tried using an AjaxMultiSelect, but then the getChoices method is never called.

Hope that helps! Thomas

--- edit ---

I am starting to think this is a problem in wicket itself.

I replaced your MultiSelect with ListMultipleChoice from Wicket itself.... and it does not work. On the first load, the change will work, but after that - not anymore. --- edit 2 ---

I am not sure if it is in any form relevant for you but:

getHeaderResponseDecorators().add(JavaScriptDeferHeaderResponse::new);

breaks it. Removing that line from my app.init solves the problem for me.

sebfz1 commented 2 years ago

Very sorry for the incredible delay in handling this issue!

As you know, I was not able to reproduce the issues on any of the components mentioned in this thread... Still, I think I could manage the data-source dependency order properly by rendering it using the OnDomReadyHeaderItem, just before the widget itself. The data-source object is still attached to the window object/scope because the widget can be detached/re-attached and needs to be able to find it.

I just published 9.6.0-SNAPSHOT, please give it a try and let me know. If you encounter an issue (like a side effect for instance) please try to reproduce in a quickstart. I'm also keen to know if it works well if the data-source is shared between several widgets...

mdbergmann commented 2 years ago

This seems to work. We couldn't see any side effects.

sebfz1 commented 2 years ago

Released wicket-jquery-ui-9.6.0.
I'll try to release 9.7.0 asap...

mdbergmann commented 2 years ago

Yep, thanks. And happy new year 2022.

sebfz1 commented 2 years ago

Released wicket-jquery-ui-9.7.0 (with kendoui.2021.3.1207). Happy New Year too! :)