Considerations for Forms and Templates
When the application posts data from a form in an HTML template, post data is lost if the action of the form is in a frame template. To solve this problem, make the frame source for the target a special request to the portal to repost the form data. The HTML response to that request includes a form containing the posted field and value pairs in hidden input fields and a Script tag that submits that form. When the browser receives this request, the JavaScript immediately submits the form to the original URL, causing the original post request to occur.
To make the frame source for the target a special portal request:
-
Construct the frameset.
The source of the target frame is the portal, with the query string cmd=framerepost&key=xxx (or something similar).
-
Store the post data on the session object as a PropertySet (name and value pairs) for later retrieval, with a key.
The key must uniquely identify the post data. The URL to post to can be kept in the PropertySet or put on the query string.
-
When the portal receives a frame repost request, it uses the incoming key to look up the stored PropertySet, then uses PropertySet to construct the HTML response with the name and value pairs in hidden input fields.
The form also has a Submit button. The HTML response contains an inline JavaScript (after the form) that submits the form.
See PeopleSoft 9.2 Application Installation for your database platform.
Combining Forms and Frames
If you include a form on a page that’s been assembled by the portal servlet, and that page’s target is displayed in a frame (either in a frame template or otherwise), then the form action cannot be Post. The portal servlet retrieves the page by using Get—not Post—regardless of the form action. Therefore, form data is lost if the form action was originally Post. Making the form action Get resolves this problem.