[Gambas-user] gambas3 webform crud example.

Matias De lellis mati86dl at gmail.com
Tue Sep 10 17:09:44 CEST 2019


Hi all,

As I comment in an previous email, the idea is make a pagekite
administration
page, and I assumed that Gambas webform is a good candidate. So, I started
writing an example to internalize with him, and I am very happy. =)

I share a complete example of CRUD handling users.
 * https://github.com/matiasdelellis/gambas3-crud-example
 *
https://github.com/matiasdelellis/gambas3-crud-example/releases/download/v0.1.1/WebformCrudExample-0.1.1.tar.gz

The intial class is WebformLogin -Everything starts from there-, but there
is a
WebFormInstall that must be called once to build the database.

Based on this experience I ask some questions:

1. The type of database, name, etc, is fixed/hardcoded, but I would like it
to
be configurable in WebFormInstall. Do you have any suggestions? It must be
written by WebformIntall and taked automatically by WebDatabase.

1.1. This is annoying, but I ask you to do a quick look at the
WebDatabase.module
to see if you believe it is well done, in particular if they it is
transparent to interact
with the rest of the classes, and if security consideration
-AdminOrOwnRequired()
and AdminRequired subrutines- to admin task is sufficient.

2. The values of inputs, positions, active WebForm, are all saved in
Session,
which is interesting, but these are accessible with the inspector, and a
GET is
emited with that data every time the focus changes between the inputs. This
is a
local security problem that would be good to improve.

3. Related, upon requesting the page again, (Pressing F5), I would expect
this data
to be cleaned, but I always get the previous data. I can't abandon the
session,
due the active WebForm is saved there too.

4. How to reuse js components?. In this example I use toastify to show a
simple
notification.

> Webform.AddJavascriptFile("toastify.js")

It add the script from 'data' folder. Shouldn't it be in public?

There is no equivalent for css?. The only way I found is to add style.css
file
in public foloder to extend the default styles.

> WebForm._AddJavascript("Toastify({text: \'" & ("Done") & "\', gravity:
\'bottom\', close: true }).showToast();")

This is correct to execute JS code?

5. How to publish the project?

> GB_HTTPD_PORT=8080 gbx3 -H

...and an Apache reverse proxy form url to 8080 port?

I have many more doubts, but I guess this is enough for a first
consultation..
:sweet_smiley:

Of course, thank you very much for all the development, and any response..

Ragards,
Matias.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190910/1438962a/attachment.html>


More information about the User mailing list