Defect #329
Error loading jQuery on initial formInDialog
0%
Description
We are trying to use jQuery on various elements in our solution. We are running into a problem when trying to apply jQuery inside a formInDialog. The first time a dialog is shown there is an error thrown. Only after the second attempt (close dialog and try again), the jQuery is applied.
I have prepared a sample solution to show what it going wrong. This is that it is suppost to do:
- open main form. in the onShow jQuery is loaded.
- change the background-color of the main form to "red" to show jQuery is active
- click on the button to open the "dialog" form in a dialog.
- change the background-color of this form to "green" to show we can apply jQuery to elements in the dialog
The last step is not performed the first time. What happens is Servoy throws an error saying:
this kind of handler cannot be attached to multiple components; it is already attached to component [MarkupContainer [Component id = contribution]], but component [MarkupContainer [Component id = contribution]] wants to be attached too
Wrapped java.lang.IllegalStateException: this kind of handler cannot be attached to multiple components; it is already attached to component [MarkupContainer [Component id = contribution]], but component [MarkupContainer [Component id = contribution]] wants to be attached too (C:\STB\Care\care_workspace\TestWebUtils\forms\dialog.js#10)
at C:\STB\Care\care_workspace\TestWebUtils\forms\dialog.js:10 (onShow)
at C:\STB\Care\care_workspace\TestWebUtils\forms\main.js:9 (onAction)
When you close the dialog and try again, the code is fired.
Any help would be greatly appreciated.
Files
History
Updated by Wouter Moerdijk almost 14 years ago
Is anybody picking this up? I need to be able to use JQuery in a reliable way in all parts of the solution.