@leneyoyo Thank you for the support, it helps knowing that people actually use some of these posts. With Wicket 1.5 some of the technical code might be out of date, but it is pretty much the same, except PackageResourceReference instead. But most of the video should still be correct.
@jensiator2 I am not sure how they would handle your issue exactly. I did notice that this similar bug exists when adding a WiQuery Dialog in a Repeating List. Every time I update that list, it seems to also add the dialog again which duplicates it (similar issue to yours). The workaround I mentioned is an idea I was toying with myself. I would personally rather not remove and add code... I would rather add it only once correctly and not worry (more efficient). Keep trying!
I Have used you IHeaderContributor for creating a jQuiry dialog component. Its basicly a panel that adds the dialog code "$(function() {$( "#dialog" ).dialog();});" in the renderHead method. Then I got some methods in the panel for the open and close functionallity. But I got some problems when this panel is updated by pAjaxRequestTarget. It works if I use renderOnDomReadyJavascript. But it adds the modal divs again and again in the bottom of the page. Got any Ideas
@jensiator2 I actually use WiQuery with Wicket, though I don't know if its necessary. At any rate, I do know what you mean, you will need to do "target.appendJavaScript(...)" and insert code to destroy and remove the dialog component, because every time the jquery is run it will add a new dialog component. You should keep track and only run the code once or try removing any dialog before adding the new one.
Hey dude awesome I am just a couple of months into a new job that uses wicket heavily and I was needing this info exactly, thanks for posting it!
leneyoyo 8 months ago
@leneyoyo Thank you for the support, it helps knowing that people actually use some of these posts. With Wicket 1.5 some of the technical code might be out of date, but it is pretty much the same, except PackageResourceReference instead. But most of the video should still be correct.
ProgramJava 8 months ago
Thanks. I was not aware of that I needed to destoy it. I'll check out the source code of wiquery. I probably want to do what they are doing.
jensiator2 1 year ago
@jensiator2 I am not sure how they would handle your issue exactly. I did notice that this similar bug exists when adding a WiQuery Dialog in a Repeating List. Every time I update that list, it seems to also add the dialog again which duplicates it (similar issue to yours). The workaround I mentioned is an idea I was toying with myself. I would personally rather not remove and add code... I would rather add it only once correctly and not worry (more efficient). Keep trying!
ProgramJava 1 year ago
Hi Thanks for good tutorial.
I Have used you IHeaderContributor for creating a jQuiry dialog component. Its basicly a panel that adds the dialog code "$(function() {$( "#dialog" ).dialog();});" in the renderHead method. Then I got some methods in the panel for the open and close functionallity. But I got some problems when this panel is updated by pAjaxRequestTarget. It works if I use renderOnDomReadyJavascript. But it adds the modal divs again and again in the bottom of the page. Got any Ideas
jensiator2 1 year ago
@jensiator2 I actually use WiQuery with Wicket, though I don't know if its necessary. At any rate, I do know what you mean, you will need to do "target.appendJavaScript(...)" and insert code to destroy and remove the dialog component, because every time the jquery is run it will add a new dialog component. You should keep track and only run the code once or try removing any dialog before adding the new one.
ProgramJava 1 year ago