B4J Question [Web][SithasoDaisy5] Questions & Answers

Mashiane

Expert
Licensed User
Longtime User
Hi Fam

This thread is for asking any question related to SithasoDaisy5.

When posting a question, please provide as much information as possible to reproduce your question especially when reporting a bug.

Here is the template:

SithasoDaisy5 Version Number (e.g. 5.23):
Browser e.g Chrome:
B4J Version e.g. 10.20:
Java Version e.g. OpenJDK 19:
Running Mode e.g. Debug:
Question Title:
Question Description:
For Bugs How to Reproduce:

Thanks in advance for your co-operation.
 
Last edited:

MarFraWare

Member
Licensed User
Longtime User
Hello,

I followed the [Web] Beginning WebApp/WebSite Development with SithasoDaisy5, but it result in an error while compiling:

B4J Versie: 10.20
Controleren code. (1.29s)
Java Versie: 19
Building folders structure. (0.32s)
Compileren code. (1.98s)
Compileren weergaven code. (0.01s)
Bibliotheken organiseren. (0.00s)
Compileren gegenereerde Java code. (4.38s)
Compileren foutopsporing code. Error
B4J line: 3819
End Sub
shell\src\b4j\example\clstablecode_subs_0.java:7584: error: code too large for try statement
catch (Exception e) {
^
1 error
only showing the first 1 errors, of 3 total; use -Xmaxerrs if you would like to see more

Any ideas?
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Hello,

I followed the [Web] Beginning WebApp/WebSite Development with SithasoDaisy5, but it result in an error while compiling:

B4J Versie: 10.20
Controleren code. (1.29s)
Java Versie: 19
Building folders structure. (0.32s)
Compileren code. (1.98s)
Compileren weergaven code. (0.01s)
Bibliotheken organiseren. (0.00s)
Compileren gegenereerde Java code. (4.38s)
Compileren foutopsporing code. Error
B4J line: 3819
End Sub
shell\src\b4j\example\clstablecode_subs_0.java:7584: error: code too large for try statement
catch (Exception e) {
^
1 error
only showing the first 1 errors, of 3 total; use -Xmaxerrs if you would like to see more

Any ideas?
Thank you for your question. To be able to help you can you please follow the template outline provided as per post #1? One of the important conditions of the question is on how to reproduce.

If you are running the SithasoDaisy Demo app, you need to run it in RELEASE mode.
 
Last edited:
Upvote 0

MarFraWare

Member
Licensed User
Longtime User
Thank you for your question. To be able to help you can you please follow the template outline provided as per post #1? One of the important conditions of the question is on how to reproduce.

If you are running the SithasoDaisy Demo app, you need to run it in RELEASE mode.
Ok, that was an easy one: compilation box on the IDE.
Thank you!
 
Upvote 0

Enrico Fuoti

Active Member
Licensed User
Longtime User
Hello Mashiane,
I'm finally starting to use sithaso5 wich looks an great project.
My approach is to try to rebuild an app i realized with sithaso2.
If you don't mind i will start to submit the problems as soon as i find them.
here are the first.

SDUIMySQLREST is missing the method SelectDistinctWhere that was included in the old SDUIMySQLE. Can you help me? is there any way to query distinct records ?

SDUI5Select is missing the method findIndexByValue

thank you for your great work
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
SDUIMySQLREST is missing the method SelectDistinctWhere that was included in the old SDUIMySQLE. Can you help me? is there any way to query distinct records ?
Hi @Enrico Fuoti , thank you for your question and thanks for you interest in SithasoDaisy5. Anytime you need help, Im here to help.

SDUIMySQLREST vs SDUIMySQLE

These are two different approaches to using MySQL and PHP. SDUIMySQLREST is based on https://github.com/mevdschee/php-crud-api, whilst SDUIMySQLE was built with just normal php. I have however managed to add functionality for one to execute their own SQL statements directly using the SDUIMySQLREST.

Example:

B4X:
Dim db As SDUIMySQLREST
    db.InitializeApiKey(Me, "contacts", Main.ServerURL, "contacts", Main.ApiKey)
    db.SetSchemaFromDataModel(app.DataModels)
BANano.Await(db.SELECT_RAW("select gender, count(*) as records from contacts group by gender"))
    chartgender.Clear
    chartgender.AddCategory("Gender")
    Do While db.NextRow
        Dim sgender As String = db.GetString("gender")
        Dim srecords As String = db.GetString("records")
        Dim gPerc As String = app.UI.PercentOf(srecords, tContacts)
        chartgender.AddSeriesValue(sgender, gPerc)
    Loop

This functionality was extensively used in this example


I will add the functionality you have requested, I was just providing a background.

Thanks again for your kind words. Appreciated.
 
Upvote 0

Enrico Fuoti

Active Member
Licensed User
Longtime User
Hi @Enrico Fuoti , thank you for your question and thanks for you interest in SithasoDaisy5. Anytime you need help, Im here to help.

SDUIMySQLREST vs SDUIMySQLE

These are two different approaches to using MySQL and PHP. SDUIMySQLREST is based on https://github.com/mevdschee/php-crud-api, whilst SDUIMySQLE was built with just normal php. I have however managed to add functionality for one to execute their own SQL statements directly using the SDUIMySQLREST.

Example:

B4X:
Dim db As SDUIMySQLREST
    db.InitializeApiKey(Me, "contacts", Main.ServerURL, "contacts", Main.ApiKey)
    db.SetSchemaFromDataModel(app.DataModels)
BANano.Await(db.SELECT_RAW("select gender, count(*) as records from contacts group by gender"))
    chartgender.Clear
    chartgender.AddCategory("Gender")
    Do While db.NextRow
        Dim sgender As String = db.GetString("gender")
        Dim srecords As String = db.GetString("records")
        Dim gPerc As String = app.UI.PercentOf(srecords, tContacts)
        chartgender.AddSeriesValue(sgender, gPerc)
    Loop

This functionality was extensively used in this example


I will add the functionality you have requested, I was just providing a background.

Thanks again for your kind words. Appreciated.
Thank you Mashiane,
I've already used SDUIMySQLRest with no problem. It works quite well.
The application i wrote with sithaso2 became kind of big and complex. I think that converting it, will be a good way to learn sithaso5 functionalities.
thank you for your support.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
SelectDistinctWhere
B4X:
BANano.Await(db.SelectDistinctWhere(Array("province"), CreateMap("category":"aaa"), Array("="), Array("province")))

Translates to

B4X:
SDUI5Fetch-Data: {"query":"SELECT DISTINCT `province` FROM `contacts` WHERE `category` = 'aaa' ORDER BY `province`"}

Added to SithasoDaisy5, to be released soon.

findIndexByValue
Added to the next version...
 
Last edited:
Upvote 0

Enrico Fuoti

Active Member
Licensed User
Longtime User
thank you mashiane,
I checked selectdistinct and selectdistinctwhere and they are now present, but it looks like they do not return any result.
btw: popup help show usage of db.json method wich is missing. it is not a big problem as data can be processessed anyway without it.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
thank you mashiane,
I checked selectdistinct and selectdistinctwhere and they are now present, but it looks like they do not return any result.
btw: popup help show usage of db.json method wich is missing. it is not a big problem as data can be processessed anyway without it.
Hi, perhaps if you can DM me a simple example that reproduces the issue.

Try and set db.ShowLog = True, this will help see what the SDUI5MySQLREST is doing internally so that you can debug.
 
Upvote 0
Top