Smart Dialog "ON GO" trigger

I have a smart dialog with 1 SDO, 1 SDB and 1 Filter.

If focus is in the filter and I press F2 (keyboard shortcut for GO), the trigger for ON GO of FRAME in the smart dialog doesn't fire.

Instead, the on GO of FRAME trigger in the filter program src\adm2\dynFilter.w fires.

Don't really understand why the "wait for go of frame" in the dialog is then satisfied and continues.

The dialog then closes without running the on go of trigger which puts the rowid of the selected record into an output parameter.

Any ideas how i get the trigger to fire (or why it isn't working).

Cheers
 
If your SmartDialog has a static GO trigger, then this will be instantiated first. The GO trigger in the filter must be dynamic. In any case, it was the last one to be instantiated so it will be the one that fires. The WAIT-FOR doesn't really care which trigger fires, as long as one of them does.

There may be a couple of things that you can do. First, instead of having a static GO trigger in your SmartDialog, use a dynamic one and make sure that it is instantiated after the filter is instantiated. As the SmartDialog's trigger is the last to be instantiated, it will be now the one that fires. e.g last line inside initializeObject:

ON GO OF FRAME PERSISTENT RUN <internal-proc>.

Alternatively, don't use GO. When F2 is pressed invoke an event other than GO (e.g. U1) and setup your SmartDialog trigger for that event. When the dialog really is ready to be closed, just apply END-ERROR to the FRAME.
 
That's not it unfortunately.

The viewer has it's own frame that sits in the dialog's frame.

It seems that the on go of frame trigger in the viewer satisfies the wait-for and fires it's own on GO static trigger.

If you choose the OK button in the dialog, the on GO static trigger in the dialog fires.

Ideally go of child frame should apply go to parent frame. (Might write code to do this instead).
 
Have you tried unchecking the Auto-Go property for the OK button? It's on the button property sheet. With this disabled, when the button is clicked the CHOOSE trigger will fire, but GO will not be applied to the frame.
 
I still would have the same problem.

The wait-for is waiting for go of the dialog frame (although it seems on go of any frame contained with the dialog seems to satisfy the wait-for).

The question is where to put the "on go" trigger code.

If you're in the viewer and press F2 (the go key) the wait-for ends but the on go of dialog frame trigger doesn't run.

I think the only way will be to put the wait-for in a repeat loop and break out when appropriate.

I was hoping there would be an override called something like applyGo in the smart dialog. The only way I can get this to work is to put code in destroyObject and check the function type that invoked it (i.e. "GO").

Unfortunately you don't seem to be able to stop the close in destroyObject if some validation fails.
 
Solution Found:

Copied {src/adm2/dialogmn.i} to a directory in our sources. (Not in same path so we can use it as and when with our dialog boxes)

Add the following after InitializeObject in the main block and before the wait-for.

Code:
ON 'GO':U ANYWHERE
  DO:
      APPLY "GO":u TO FRAME {&FRAME-NAME}.
      RETURN.
  END.
 
Top