How can I display a dialog canvas in Oracle Forms Builder?

Ahmad picture Ahmad · Nov 18, 2012 · Viewed 19.9k times · Source

I have built a form in which the user can view multiple rows of data pulled from a table. The user has the option to select a row, then pressing a button to reject the data in that row, (to be marked as rejected in some STATUS field).

I have also designed a rejection confirmation dialog with the ability for the user to enter some comments or reason for rejection.

I have set up the dialog canvas to appear on its own window with the Type proeperty set to Dialog.

When the user selects a row to reject, here is the code that gets executed:

BEGIN
  GO_BLOCK('BLK_ALL_RECORDS');

  FIRST_RECORD;


    IF :FRM_ALL_ROWS.CHK_SELECT = 1 THEN
      :FRM_REJECTION.ID := :FRM_ALL_ROWS.ID;
        GO_BLOCK('BLK_REJECTION');
        SHOW_VIEW('CNV_REJECTION');
        EXIT;
     ELSE
         NEXT_RECORD;
     END IF;   

END;

And the rejection form has two buttons, one to confirm and one to cancel. Let's just focus on the cancel button for now. Here is the code that is executed once the Cancel button is pressed:

:BLK_ALL_ROWS.CHK_SELECT := 0;  /* Forces removal of the check mark */
GO_BLOCK('BLK_ALL_RECORDS'); 
HIDE_VIEW('CNV_REJECTION');

The only problem is : once the dialog form appears, it hides the parent form, until the form is dismissed. How can display the dialog form ontop of the parent form with both of them visible (in a modal way?)

Answer

Peter Å picture Peter Å · Nov 19, 2012

The navigation between different canvases can be little bit tricky to get to work. Hard to say what is the problem with not having the form in front of me but the first thing I should do is making sure that the 'Raise on entry' canvas property of the 'main' canvas is set to 'Yes'. This should force this canvas to be displayed when you are moving the cursor back to block 'BLK_ALL_RECORDS'.

Another alternative could be to use SHOW_VIEW() in the cancel dialog logic to force the main canvas to be displayed.