[Gambas-user] How to load a new page on gb.web by code

Mayost Sharon sharon at 455.co.il
Wed Sep 20 20:23:51 CEST 2023


---------- Original Message -----------
From: T Lee Davidson <t.lee.davidson at gmail.com>
To: user at lists.gambas-basic.org
Sent: Wed, 20 Sep 2023 10:24:12 -0400
Subject: Re: [Gambas-user] How to load a new page on gb.web by code

> On 9/19/23 16:10, Mayost Sharon wrote:
> > Hello first thanks But I tried to put the code as you say, and it's still not good. 1. When I click the button on the second 
> > page it returns to the Main.webpage page 2. It is very inconvenient to write a lot of code inside Wabpage because if you can't 
> > stop and check for bugs, etc. Maybe I don't understand the process of the gb.web, but my expectation was that every page when I 
> > click on submit buttons that are supposed to perform an action should have been conducted on the page itself that was loaded, 
> > unless I specifically say in the action to go to another page What I currently understand is that every time he performs an 
> > action he always returns to the main page The question is, does it have to be this way? Thank you
> 
> Well, since I don't have time at present to analyze the gb.web code to 
> determine how to answer your original question posed in the subject line, all 
> I can suggest at the moment is that you use Javascript to validate the form 
> data prior to it being submitted, and use Main.webpage as a main controller 
> similar to this: <%   If Request.Post.Fields.Count > 0 Then     Select 
> Request.Post["gb_action"] ' gb_action will be defined differently in each 
> distinct page       Case "Webpage1"         'Render or Include Webpage1      
>  Case "Webpage2"         'Render or Include Webpage2'     End Select   Endif %>
> 
> -- 
> Lee
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
------- End of Original Message -------

Hello

Thanks again
And sorry for the English translation

According to Benoît answer
See gb.web
You shouldn't manage multiple pages on the same project, so you can't switch from page to page
If I understand correctly it should actually be a PHP joke that has several PHP pages
Then I move from page to page via ACTION or REDIRECT
In GB, then you need to create several projects, each project is a page, and then the transition between one and the other will also be with ACTION and REDIRECT
But instead of writing the name of the page with a PHP dot, we at GB will write for example:
prj_web1.gambas
prj_web2.gambas
prj_web3.gambas
...

Anyway, I'm also trying to reach a solution, I'm currently preparing an example.
When I'm done I'll add it to this discussion
And we will see if this is a correct solution


More information about the User mailing list