Friday, July 31, 2009

Multiple tabular forms on one Apex page

As you probably know, you cannot have multiple tabular forms on one Apex page. One way around this limitation is to create your own reports and processes. This is described in Denes Kubicek's multiple tabular forms example.

But you can also trick your application to make it look like two tabular forms are on the same page.



This page actually consists of two pages. The form at the bottom is defined on another page. By using an iframe, this 2nd page is displayed on the same page as the form at the top.

Start by creating a normal tabular form page. Nothing special there.

Create a second page as a new blank page.
Change the template to Printer friendly. This way nothing extra will be shown on the page.

Now you can add the tabular form region as you would normally do. Make sure that the submit and cancel buttons branch back to the page you are now creating. This is important. There should be no way to go to any other page from this page. Otherwise, you are going to be stuck on the wrong page in the iframe.

Go back to the first page and create a HTML region on this page. Change the Region source to something like this:



No comments:

Post a Comment