Invalid Web Dialog
-
I have been using a web dialog as an interface and lately I've been getting the error "#<Exception: Invalid Dialog>" if I submit more than once. Does anyone know why this is?
I am using mostly get_element_value instead of parameters.
-
@cjthompson said:
lately I've been getting the error "#<Exception: Invalid Dialog>"
Never saw that. Can you post some code?
-
I've been trying to get a code snippet to replicate the problem, but I haven't been able to. I just wanted to know if anyone else has had this problem.
-
CJ,
@cjthompson said:
if I submit more than once.
Can you please clarify what exactly you mean by submit? Not sure if you mean HTML form submit or not...
If you do, I have only used a button onclick event and a trap for escape.
Greg
-
sorry, I meant executing window.location = skp:callback_method_name.
I think this might be an issue with ASP. I haven't been able to replicate it with html.
-
Okay. This is just plain stupid.
I stepped through my code to find the problem, and it turns out that somehow creating a new bounding box invalidates my web dialog.
here is a code snippet to test with (I used the console):
testWebDialog = UI;;WebDialog.new("Test;",true,"webDAtts",700,500) testWebDialog.set_html("<head></head><body>This is a test</body>") testWebDialog.show puts testWebDialog.visible? #(should return true) Geom;;BoundingBox.new puts testWebDialog.visible? #(should return false) -
I noticed that this was fixed in 7.1
-
-
If you create a dialog assigning a @class variable to reference it, and the dialog is closed, then the variable holds a reference to the now invalid dialog.
Typical code
def create_dialog if !@dlg @dlg = UI;;WebDialog.new( ... ) end @dlg.show { } endNow if the dialog is closed, the @dlg variable still holds a reference to the now invalid dialog. In addition to checking whether the @dlg variable exists, you need to check if the dialog is visible?
def create_dialog unless @dlg and @dlg.visible? @dlg = UI;;WebDialog.new( ... ) end @dlg.show { } end -
Or just recreate the dialog every time...
def create_dialog @dlg = UI;;WebDialog.new( ... ) @dlg.show { } end
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement