Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread new user questions
Wed, Feb 10 2016 11:26 AMPermanent Link

erickengelke

Avatar

Hi,

This is day one of using EWB, and I have some newbie questions.  I hope the answers will help other newbies too.

1. All the samples are single pages.  I expect apps to have multiple screens.  Usually for web apps I design separate URLs for each page and link them together, like Login, MainMenu, Search, Details.  Does anyone have an example of a multipage web app?

2. How do you redirect to a new page.  I know how to do it in javascript, but not in EWB?  

3. My backend has to be PHP on Unix server, using POSTs (so passwords are not in log files like with GET).  Unix currently precludes using the Elevate server.  Any examples of PHP/Apache?

4. Has anyone written a book?  The examples hint "important to do this" here and there, but there is no tutorial explaining what/why?

5. I see there is local storage, has anything like Apache/PHP sessions storage been written to pass sessions among pages, or do I have to build that myself.
Wed, Feb 10 2016 12:03 PMPermanent Link

Uli Becker

Hi,

> 1. All the samples are single pages.  I expect apps to have multiple screens ... Does anyone have an example of a multipage web app?

No problem - just create a number of forms (like you do in a desktop
application) and open these forms with formx.show or formx.showmodal.
In the project options (tab Forms) you can decide whether to autocreate
these forms or not.
If a form is not autocreated, you have to create it before being able to
show it:

Form2 := TForm2.create(Application);
Form2.Show;

Please note that you have to set the "Visible" property of all
AutoCreated Forms to false except the main form. Otherwise all
autocreatd forms would be visible at the application's start.

And don't forget to add all units that you want to access to the "uses"
clause.

> 2. How do you redirect to a new page.  I know how to do it in javascript, but not in EWB?

I quickly created a very basic application for you - it's attached.

> 5. I see there is local storage, has anything like Apache/PHP sessions storage been written to pass sessions among pages, or do I have to build that myself.

The sample application shows you how to "pass" variables from one form
to another. Just declare them as "public". No local storage needed for that.

Hope that helps for the first steps.

Uli




Attachments: Newbie.zip
Wed, Feb 10 2016 12:16 PMPermanent Link

Matthew Jones

First off, you would be best off using the General topic for this sort
of question. The demos is for people showing examples.

> 1. All the samples are single pages.  I expect apps to have multiple
> screens.  Usually for web apps I design separate URLs for each page
> and link them together, like Login, MainMenu, Search, Details.  Does
> anyone have an example of a multipage web app?

WebBuilder is a "SPA" or "Single Page Application" development tool.
Things like Twitter and GMail use this mechanism - you update the page
as required by the data and activities. You actually can use #page
sections if you want, but they are not necessary. (See the general
newsgroup for previous information on that.)


> 2. How do you redirect to a new page.  I know how to do it in
> javascript, but not in EWB?

       Window.Location.Replace('https://myserver.com/page');

But you don't really want to do that. 8-)


> 3. My backend has to be PHP on Unix server, using POSTs (so passwords
> are not in log files like with GET).  Unix currently precludes using
> the Elevate server.  Any examples of PHP/Apache?

Look into TServerRequest.

> 4. Has anyone written a book?  The examples hint "important to do
> this" here and there, but there is no tutorial explaining what/why?

The manual included is quite good, but many common questions have been
asked before - search the newsgroups.


> 5. I see there is local storage, has anything like Apache/PHP
> sessions storage been written to pass sessions among pages, or do I
> have to build that myself.

Go with the flow of SPA and you don't need to pass anything to any
other page. It is all in the form properties, or a global or two. For
persistence, use localStorage.

--

Matthew Jones
Wed, Feb 10 2016 2:57 PMPermanent Link

erickengelke

Avatar

Thanks for the help.  I think I should be able to proceed now that I the feel.  This is more like Delphi than I expected.  Yea!

Erick
Image