Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
46
rated 0 times [  52] [ 6]  / answers: 1 / hits: 22293  / 12 Years ago, mon, april 16, 2012, 12:00:00

Im using Dojo to create a simple dialog to create a user in a system. The problem is I get the error:



Tried to register widget with `id==user_submit` but that `id` is already registered


user_submit, is a Dojo button I have to finish the form inside the dialog. When I close the dialog by clicking it and submitting the form there is no problem in opening the dialog again (in the click event on the button I have this line of code:



dijit.byId(user_submit).destroy();


but if I close the dialog through the [x]-link / button in the top-right corner I don't destroy the button and then can't open the dialog again without reloading the page.



How do I get Dojo to destroy the button or how to a overload the click-event on [X]-link / button, so I can write the destroy command for the button?


More From » button

 Answers
8

Found a solution. by using dojo.connect().



myDialog.connect(myDialog, hide, function(e){
dijit.byId(user_submit).destroy();
});


Would have postet this shortly after i posted the quistion, but I didn't have enough points, so here is the answer again, just a little late :-)


[#86217] Saturday, April 14, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bobbyallanh

Total Points: 693
Total Questions: 120
Total Answers: 101

Location: Bermuda
Member since Thu, Apr 20, 2023
1 Year ago
;