In 2.2.5, after a formInDialog was closed, the onShow event would trigger for the underlying form. In 3.0rc4 the onShow in the underlying form no longer triggers. Is this as intended? It’s fine if it is, but I will need to change quite a bit of code in my solution, so I thought I would ask first.
In a somewhat related issue, when a print preview closes, the onShow event in the underlying form does still trigger as it did in 2.2.5. This is necessary, as it was the only way to be able to check if the last print preview had printed. Please don’t change this behaviour.
well onhide is also not triggered on underlaying form (changed since 2.2.x), so this is not sometihng new.
The idea is that they are still visible for the duration of the dialog.
Here is my scenario:
I pop up a form in dialog, and based on some action the user takes in that form in dialog, I may want one of several methods to execute when the form in dialog closes. My technique was to set a global text field to be the string of the name of the method to run with any arguments, then call another method that does an ‘eval( globals.gMethodToExecute )’. This eval method was being triggered by the onShow event of the underlying form, but in Servoy 3.0rc4, that no longer triggers. I can just as easily cause the eval to trigger on the onHide of the form in dialog, but I will have to change my code in several places. I actually think that is cleaner, but I wanted an answer to this question first: Is it intentional that the onShow event of an underlying form no longer triggers after a form in dialog is closed?
yes, it is! read Jan’s post
Is it intentional that the onShow event of an underlying form no longer triggers after a form in dialog is closed?
I don’t mean to beat a dead horse, but it appears to me that Jan’s post does not address my question. Jan refers to the onHide of the underlying form. I am speaking about the onShow of the underlying form. By underlying form, I am talking about the form that I am returned to after the form in dialog is closed.
In 2.2.5, when I close a form in dialog, the form I am returned to triggers its onShow event. In 3.0, in this case, the onShow is not triggered. I can’t find any documentation of this being changed in any of the beta or rc release notes, so I am wondering if it is intentional.
We do not fire onHide and onShow anymore on the underlying form because it is still visible (and not being hidden and shown again)
Another reason is that we for performance disconnect the form from the foundset, which result in the form showing no data, which is strange when having a small dialog and seeing the content in background disappear
That is fine. The first issue regarding a form in dialog is resolved.
Separatly, by your reasoning, the underlying form’s onShow event should still trigger after a print preview is closed, since the underlying form is completely hidden by the print preview? Triggering the underlying form’s onShow event is required since it is the only event where I can attach a method that checks if the last print preview has printed. The onHide of the print preview form definately does not trigger when the print preview is closed. This is the current behavior in 3.0 and 2.2.5 and I would prefer that it not be changed.
onHide is called (on the current form) when printpreview is shown and onShow is called (on the form we are going back to) when the printpreview is closed (tested with Servoy 3.0 rc5)
Could you reproduce the behaviour you see in a sample solution?
BTW we never did call anything on the form being shown in printpreview (since printpreview is not really a form but a collection of form Parts like header, mutiple bodies and footer)
The behavior you describe is what I see also, but that is not the issue that concerned me. The absence of the onShow event triggering in the form below a form in dialog after the form in dialog is closed is the issue. It was a change from 2.2.5 and was not documented in any 3.0 release notes. It affects a large portion of my code and I wanted to be sure that the change was intentional and not a symptom of something else. I have a sample solution, but I continue to get errors when trying to attach files to forum posts
Upload Error: Could not upload Attachment to ./files/close_fid_no_onshow_30rc5_109.servoy.
My file is named ‘close_fid_no_onshow_30rc5.servoy’ and not ‘close_fid_no_onshow_30rc5_109.servoy’ if that gives you any clue.
In 3.0 many events are streamlined so that they are now predictable and exactly in sync. Because the form is still visible and no onHide is called there is no onShow called for that form in that case the event doesn’t make much sense because the form is not shown at that time it was already shown long time ago (and the onshow was called)
What you should do if the onShow (what kind of stuff do you there if you depend on a form in dialog close?) must be called. Is right after the call:
application.showFormInDialog() call your onShow();
For my purpose, that wouldn’t work, but using the formInDialog’s onHide instead serves my purpose. Thank you for the clarification.