Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Super simple, except for me - multiple "masterforms" in one application


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Jun 17, 2017 10:45 PM Last Post By: ib elfving Threads: [ Previous | Next ]
ib elfving

Posts: 33
Registered: 8/28/01
Super simple, except for me - multiple "masterforms" in one application  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 17, 2017 1:41 AM
I am building an application where I need two forms. One form for users that have an account, and another for casual users (it's a shipping system)

The users with accounts are directed to the login page by default (http://www.xyz,dk:8888/$/start) and this is working as it should.

I now need a page where the receiver of a shipment can trace it e.g. http://www.xyz,dk:8888/track?barcode=12345 - this web address is send by email and gives the user an idea of where the goods currently are.

How do I do that?

I have tried to define the intraweb form as a "custom content handler", but gets a syntax error (to few parameters on the create statement). I have also tried to place the following code on the login form

initialization
Ttracking.SetURL('/','track');
TLoginside.SetAsMainForm;

This seems to function some times, but the first call is directing the user to the login page instead of the trace page, additional calls to the trace site is working.

Any Ideas?
regards ib
Joao Lira

Posts: 40
Registered: 3/25/03
Re: Super simple, except for me - multiple "masterforms" in one application  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 17, 2017 4:22 AM   in response to: ib elfving in response to: ib elfving
ib elfving wrote:
...
I now need a page where the receiver of a shipment can trace it e.g. http://www.xyz,dk:8888/track?barcode=12345 - this web address is send by email and gives the user an idea of where the goods currently are.

Hi,

I think you should continue looking for a 'custom content handler' solution. I had a demand similar to yours and a 'custom content handler' was the faster and best way to accomplish it. Go to here http://iwdemos.codeplex.com/SourceControl/latest and click the 'Download' link (below the main menu) to get the latest version of Atozed demos. There you will find at least two functional examples of content handlers. The current version of the demo file is 'iwdemos-84484.zip'.

The example at Atozed page has an outdated version of the parameters passed for the 'content handler' 'execute' function, but the examples from the above site are ok.

Joao Lira.

ib elfving

Posts: 33
Registered: 8/28/01
Re: Super simple, except for me - multiple "masterforms" in one application  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 17, 2017 10:55 AM   in response to: Joao Lira in response to: Joao Lira
hi Joao Lira,
thank you for the reply. I am afraid that the sample behaves just like i have experienced with my own solution.

It is quite easy to see the problem. Load the sample into your delphi compiler and start it, but do NOT press a browser button in the small startup window. - The server is now running, and you can open a browser and by hand enter for instance http://127.0.0.1:8888/blueform.html - This takes you to the wrong form (the main form). If you try to enter the url (http://127.0.0.1:8888/blueform.html) again, the browser displays the correct form.

What I need, is a way to display "the blue page" without first displaying the "mainform"

regards Ib
Daniel Fields

Posts: 622
Registered: 11/29/04
Re: Super simple, except for me - multiple "masterforms" in one application  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 17, 2017 4:14 PM   in response to: ib elfving in response to: ib elfving
You could also just use the ServerController's OnGetMainForm or OnNewSession events. I use the OnNewSession event to do most processing when the session is started. You can read the parameters through ASession.RunParams in that event.

Custom Content Handlers will work also, as mentioned in the first answer. I cannot think of any advantages, nor disadvantages, to either approach.
ib elfving

Posts: 33
Registered: 8/28/01
Re: Super simple, except for me - multiple "masterforms" in one application  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 17, 2017 10:45 PM   in response to: Daniel Fields in response to: Daniel Fields
Hi Daniel,
As always, something I can use :-)

I experimented with ongetmainform, and it is working perfectly

I do have one issue. How can I get the calling URL in ongetmainform. I have tried to check several places, but with no luck. "/track" seems to disappear.

e.g. if I call my webside with http://127.0.0.1:8888/track?barcode=xyz, then I would like to be able to check the url for "/track" in order to select the correct "mainpage", but I cannot find the complete url anywhere (running SA). Do you know if it is possible to get it ?

regards ib
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02