This discussion is archived
4 Replies Latest reply: Jul 2, 2013 8:34 AM by c4b0t42 RSS

Modal Region Error Notification

Jiminy Newbie
Currently Being Moderated
Hello,

I am using apex 4.2.

I have created a Modal Region using the Modal Region Template which I open and close with the openModal and closeModal javascript respectively. I have validations on the items within my Modal Region such as a field cannot be null when the save button is clicked. The save button submits the page.

The problem is that the error notification displays on the Apex page and not within the Modal Region itself. Is there any way to get the error notification to display within the modal region template?

Thanks,

JIM
  • 1. Re: Modal Region Error Notification
    Jiminy Newbie
    Currently Being Moderated
    Bump!
  • 2. Re: Modal Region Error Notification
    Joni Vandenberghe Pro
    Currently Being Moderated
    Did you consider putting your popup on another page and using an iFrame?
    That way close popup is just a process on that page, and won't be run when the validations fail, so your notification will show on your pop-up.

    Alternatively you could do "live" validations by using jQuery/Ajax and do the validation while the user is typing, but I think using an iFrame is better.
  • 3. Re: Modal Region Error Notification
    Tom Petrus Expert
    Currently Being Moderated
    This is the reason why i like using the skillbuilders modal page plugin so much too. It does all of the handling and it uses an iframe. When i need dml done in a modal popup i always create a new page and use that. This gives you much more control over what is happening: there is a page template you can adjust and the dml processes are contained.
    If you want to keep things in the one and same page you will have to fiddle a lot with javascript to make this work. When in your case a modal popup is opened, this is all still one page. Submitting the page will of course cause the modal to disappear. If you'd want to keep the modal opened after a submit, it'd need to be reopened, and the success/error message would have to be moved to this region. This is more hassle than using another page displayed in an iframe.
  • 4. Re: Modal Region Error Notification
    c4b0t42 Newbie
    Currently Being Moderated

    Hello,

     

    I found this post, looking for a solution to a similar issue. In case anyone else comes across this post you can achieve this using jQuery append method.

     

    http://api.jquery.com/append/

     

    $('#MY_MODAL_REGION_ID').append($('#uNotificationMessage'));

Legend

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