Is it possible to call the webpage form which name of the form is loaded from database? Example, my table’s structure is like below:
menu_code | menu_text | menu_form
T01 | Purchase Order | fpurchase
T02 | Receive Order | freceive S01 | Sales Order | fsalesorder
S02 | Delivery Order | fdeliveryorder
S03 | Invoice | finvoice
If user choosing menu Sales Order, then the webpage form name fsaleorder will be shown.
I knew there was a post to explain how to call the webpage using Dictionary type. I modified the code using array technique to make a dynamic form name, but it’s always fail.
This is definitely possible. Most my content and forms a loaded dynamically from the database as well.
I handle this a couple ways:
Put each control of your form into a separate WebContainer
Create a database table to represent the “form views”
– You could create a simple table like “FormName”, “FormInfo” and have forminfo have a serialized version of your form.
–You could also create a more complicated table that might look like:
“Form Name”, “Index”, “Field Label”, “Field Type”, “MaxValue”, “MinValue” etc…
You App would get the info from the database and loop through all the necessary information and dynamically load the correct WebContainers on top of each other.
You’ll probably need to create a mapping between either your form names or your form control names and their control in Xojo
Select case containerName
Case "MyForm1"
return new myForm1
Case "MyForm2"
return new myForm2
...