4 Replies Latest reply on Jul 2, 2013 3:34 PM by Chris.F

    Modal Region Error Notification


      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?


        • 2. Re: Modal Region Error Notification
          Joni Vandenberghe
          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
            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



              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.