This discussion is archived
1 Reply Latest reply: Nov 14, 2012 1:35 PM by MLBrown RSS

CheckBox Changed Trigger

893566 Newbie
Currently Being Moderated
I did write a trigger when-checkbox-changed for a check box in the 'mainwindow' as
DECLARE
BEGIN
IF :SELECT_CHKBOX = 'Y' THEN
     SHOW_WINDOW('DETAILSWINDOW');
     GO_ITEM('DETAILSWINDOW.NAME');
     EXECUTE_QUERY;
     
     
END IF;
END;

It would take me to the details_window.I have a button in the details_window and when I click on it gets me back to the 'mainwindow'. The code for when-button-pressed trigger is
DECLARE
BEGIN
     HIDE_WINDOW('DETAILSWINDOW');
SHOW_WINDOW('MAINWINDOW');
     GO_ITEM('MAINWINDOW.ID');
     EXECUTE_QUERY;
END;

Now I could navigate from main window to details window two times. Third time if I click on the check box I see no action is performed. I am on the mainwindow and the checkbox is checked but the deatils window is not dispalyed.

Please help me with any steps to debug this issue.
  • 1. Re: CheckBox Changed Trigger
    MLBrown Journeyer
    Currently Being Moderated
    I hardly ever use more than one window for an Application, but what happens if you don't do the SHOW_WINDOW built-ins and let forms take care of that for you? The items should be attached to a canvas and the canvas attached to a window so the GO_ITEM should be able to handle displaying the window. Just comment out the SHOW_WINDOW and see what happens. Your code would be:
    DECLARE
    BEGIN
      IF :SELECT_CHKBOX = 'Y' THEN
        -- SHOW_WINDOW('DETAILSWINDOW');
        GO_ITEM('DETAILSWINDOW.NAME');
        EXECUTE_QUERY;
      END IF;
    END;
    and
    DECLARE
    BEGIN
      HIDE_WINDOW('DETAILSWINDOW');
      -- SHOW_WINDOW('MAINWINDOW');
      GO_ITEM('MAINWINDOW.ID');
      EXECUTE_QUERY;
    END;

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points