Board index » delphi » Page jumping in WebSnap/IntraWeb.

Page jumping in WebSnap/IntraWeb.

2007-06-09 02:56:06 PM
I have a Websnap/IntraWeb application with some problems.
(see also
One of them is jumping pages.
The reason why I post this problem here also, is because I think it is
more WebSnap related.
As from the WebSurvey example I go from one page to the other in the
onclick event of a IWButton.
The pages are built like in the example with two forms per webpage
(websnap page with intrweb producer + intrawebform with all the handling).
The pages work when I jump to it from websnap start menu or browser.
Even a url link on the page or accompanied javascript like
"location.href = 'Customers' ;" works.
The problems come when jumping from one page to another inside Delphi.
The suggested jump is:
ProduceResponse := False;
DispatchPageName('Customers', WebContext.Response, []);
This gives a Intraweb error: Cannot find submit component.
This message disappear when on the target form exists an object with the
same name as the originating object on the first form.
The second form is then displayed, but actions on that form fall back to
the first form, which is reshown.
The browser navigator address field was not updated with the form name
and hoovering links show 'firstform#' .
I tried some alternatives (as suggested elsewhere in the groups):
One is to simply replace the respons from the currentpage with that of
the desired page.
- Web Context.Response.Content := NewPage.IWPageProducer.Content;
This gave the same problems as above.
The other was to use Sendredirect:
- WebApplication.Response.SendRedirect('Customers'); or
- WebContext.Response.SendRedirect('Customers');
With these two I fall back to the login screen.
It seems that I loose my user Session in this case.
If I look in the logs, I see the redirect to the second page, but in the
header the cookies are missing.
How can I add them?
PS: It makes no difference if I include ProduceResponse := False or not;
So, what is needed to make correct jumps inside Delphi from one
websnap/intraweb page to the other?
Regards, Gerard Vanderveken.

Re:Page jumping in WebSnap/IntraWeb.

I did some tests in a pure WebSnap project (without IntraWeb pages) and
came to the constatation that sendredirect also looses the usercontext.
I found another solution for jumping pages:
ProduceResponse := False;
RedirectToPageName('Sites', nil, WebContext.Response, []);
This seems to work OK and preserves my user & DB context.
However I have a problem for jumping to pages which have not the
wpPublished setting in the WebPageInfo.
If I comment this setting out, an error 'Page not found' is shown.
How can I jump to unpublished pages?
Regards, Gerard.