Render Twice

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Render Twice

BrunoBB
Hi,

Maybe for Seaside list ?

My GemStone application integrate very well with a Java Form application.

Flow (user is already logged in seaside):
1- User click an image to fill a Form.
2- A redirect take place to a Java Application with an uuid param in the url and the value of _s and _k also as parameters).
3- Java aplication take the uuid param call a Seaside Rest-Service (_s and _k are stored as hidden in Java form).
4- Rest Service answer an XML.
5- Java Form show some values in the form (from the Rest response).
6- User fill the rest of the form.
7- User click on "Send" button in Java Form.
8- Java Form store the form in mySQL.
9- Java Form do a Post to another Seside Rest Service.
10- Seside POST Service answer and HTML code that is a redirect to original page in 1 (using _s and _k hidden values in the form).
11. Java form take the response of 10 (post service) and load it in the browser.
12. A redirect take place to the original seaside page (step 1) with the same _s and _k. And the seaside page is updated with some Java Form values.

This is working pretty well.  :)
But if instead of doing a redirect i use an iframe then in step 12 the seaside page is rendered twice.
One with the original values of step 1 (with outdated data) and other with the correct page.

any idea of what could be wrong ?

regards,
bruno

Reply | Threaded
Open this post in threaded view
|

Re: Render Twice

BrunoBB
Hi,

Never mind. JavaScript error :(
  window.location.href = "', url,';" changed for   top.location.href = "', url,';" and fixed.

Now i have other problem...

The user is in Seaside app and the value of _k is kvalue-1 (let's assume this).
(this _k is sent to the Java app so after the Jave app is done return back to seaside passing _k as parameter)

Then the user click an image and an iframe (with Java app) is loaded into the page. This change the value of _k and until now i can not catch it inside renderContentOn:.

How to catch the value of _k when an iframe is loaded into the page ?
(k := self session currentRequest at: '_k' ifAbsent: ['error'].)

This gives the previous _k before the iframe was rendered.

Regards,
Bruno