This discussion is archived
1 2 Previous Next 19 Replies Latest reply: Aug 3, 2012 4:04 PM by sect55 Go to original post RSS
  • 15. Re: Skillbuilder Modal Page Auto close
    sect55 Journeyer
    Currently Being Moderated
    Tom,

    Thanks for all the hard work and time you put into resolving my issue.

    I saw that it works great on APEX.ORACLE.COM. I then tried to apply it to my company's APEX environment and it didn't work. I may have missed something. I click on the Edit Link and closes the modal page but does not run the javascript on the parent page. I don't even get the alert. What could have gone wrong????

    Can you tell me all the steps you did to change my application to work? I must be missing something?

    Robert
    http://apexcsjss.blogspot.com
  • 16. Re: Skillbuilder Modal Page Auto close
    sect55 Journeyer
    Currently Being Moderated
    Tom,

    FYI -- APPL_PC_EMPLID is usually set during post- LDAP authentication.But when I ported it over to APEX.ORACLE.COM, I could not use LDAP so it was lost. Sorry about that!

    Robert
    http://apexjscss.blogspot.com
  • 17. Re: Skillbuilder Modal Page Auto close
    Tom Petrus Expert
    Currently Being Moderated
    sect55 wrote:
    I saw that it works great on APEX.ORACLE.COM. I then tried to apply it to my company's APEX environment and it didn't work. I may have missed something. I click on the Edit Link and closes the modal page but does not run the javascript on the parent page. I don't even get the alert. What could have gone wrong????

    Can you tell me all the steps you did to change my application to work? I must be missing something?
    Okay, so you must have most things working if the modal opens and can be closed. It has to be either the return value or the dynamic action for a manual close.

    Page 7:*
    <ul>
    <li>
    IR Existing Requisitions: column ID > column link:
    Link attributes:
    onclick="return false;" class="edit-click"
    Target: URL
    URL: #ID#

    This assigns the class with which we assign the dynamic action to it, and stores the ID in the href attribute of the link for easy selection
    </li><li>
    Dynamic action "Close modal and return selected value":
    Click, jQuery selector, .edit-click, bind
    True action: execute javascript:
    //close the modal and provide it with a return value object
    //in this case i hackedy use the href attribute to hold the ID value
    parent.$(parent.document).apex_modal_page('close', $(this.triggeringElement).attr('href'));
    This will take the ID from the href attribute and pass it to the close action as a return value
    </li>
    </ul>
    Page 11:*
    <ul><li>
    Dynamic action "Modal Manual Close", true action Execute javascript:
    alert("modal was closed with return: "+this.data.modalPageCloseValue);
    var lReturn = this.data.modalPageCloseValue;
    
    if(lReturn){ //there is a return value
       if(lReturn=='CREATE'){
          //just close dialog
       }else{
          //an ID is returned. Set P11_ID in a redirect, page will load and fetch correct values due to row fetch process
          window.location.href = 'f?p=&APP_ID.:&APP_PAGE_ID.:&SESSION.::::P11_ID:'+this.data.modalPageCloseValue;
       };
    };
    This will alert the return value (i put that in to trace my steps). If there is a return value, it'll check if this is 'CREATE' (new record, just close dialog) or something else, in our case an ID. Redirect to same page and set P11_ID to the returned value.
    </li><li>
    If the page in your company's app is not 11, then make sure to adjust this too!
    </li></ul>
  • 18. Re: Skillbuilder Modal Page Auto close
    sect55 Journeyer
    Currently Being Moderated
    Tom,

    Thanks for recapping. My colleague informed me (I took the day off from work today) via email that I had live and not "bind". He was using the same modal page on his page and he said when he changed it to "bind" it worked.

    Thanks again for your time. I learned alot from you. I hope one day I can return the favor.

    Robert
    http://apexjscss.blogspot.com
  • 19. Re: Skillbuilder Modal Page Auto close
    sect55 Journeyer
    Currently Being Moderated
    Tom,

    Thanks for recapping. My colleague informed me (I took the day off from work today) via email that I had live and not "bind". He was using the same modal page on his page and he said when he changed it to "bind" it worked.

    Thanks again for your time. I learned alot from you. I hope one day I can return the favor.

    Robert
    http://apexjscss.blogspot.com
1 2 Previous Next

Legend

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