1 Reply Latest reply: Jan 23, 2013 6:22 AM by VC RSS

    close modal set value

    wowl
      Hi,

      I have a modal popup that pops up fine however when the modal is closed I want to set a value on page 0 but cant seem to get it to work.

      The is the code I'm using in the dynamic action, the section in bold is what I've added hoping to set a value but it doesn't seem to set it. The apex.event.trigger above it does seem to work and i've used to refresh reports so I tried adding a dynamic action that sets the variable when the value is changed but that didnt work either?

      Any ideas what I'm doing wrong?


      +/* prevent default behaviour on click */+
      var e = this.browserEvent;
      var tgt = this.triggeringElement;
      e.preventDefault();
      +/* Trigger JQuery UI dialog */+
      var horizontalPadding = 30;
      var verticalPadding = 30;
      +$('<iframe id="modalDialog" src="' + $(tgt).attr("href") + '" />').dialog({+
      title: " ",
      autoOpen: true,
      width: 1000,
      height: 600,
      modal: true,
      +close: function(event, ui) {+
      apex.event.trigger('#P300_AFTER_MODAL','select','');
      +$(this).remove();+
      var pValue='N';*
      +$x('P0_POPUP_MODE').value = pValue;+
      +},+
      +overlay: {+
      opacity: 0.5,
      background: "black"}
      +}).width(1000 - horizontalPadding).height(600 - verticalPadding);+
      return false;
        • 1. Re: close modal set value
          VC
          wowl wrote:
          Hi,

          I have a modal popup that pops up fine however when the modal is closed I want to set a value on page 0 but cant seem to get it to work.

          The is the code I'm using in the dynamic action, the section in bold is what I've added hoping to set a value but it doesn't seem to set it. The apex.event.trigger above it does seem to work and i've used to refresh reports so I tried adding a dynamic action that sets the variable when the value is changed but that didnt work either?

          Any ideas what I'm doing wrong?


          +/* prevent default behaviour on click */+
          var e = this.browserEvent;
          var tgt = this.triggeringElement;
          e.preventDefault();
          +/* Trigger JQuery UI dialog */+
          var horizontalPadding = 30;
          var verticalPadding = 30;
          +$('<iframe id="modalDialog" src="' + $(tgt).attr("href") + '" />').dialog({+
          title: " ",
          autoOpen: true,
          width: 1000,
          height: 600,
          modal: true,
          +close: function(event, ui) {+
          apex.event.trigger('#P300_AFTER_MODAL','select','');
          +$(this).remove();+
          var pValue='N';*
          +$x('P0_POPUP_MODE').value = pValue;+
          +},+
          +overlay: {+
          opacity: 0.5,
          background: "black"}
          +}).width(1000 - horizontalPadding).height(600 - verticalPadding);+
          return false;
          always include your code between {noformat}
          {noformat} tags
          
          what does that *$(this).remove();* do?
          
          have you tried to debug by adding an alert message?