B4J Tutorial SithasoDaisy TailwindCSS UI Toolkit: Q & A

yiankos1

Well-Known Member
Licensed User
Longtime User
Hello my friend,
I am trying my first steps with Sithaso. Before i start coding my new app, i would like to know if i can use an sqlite database (basically it is sqlitecipher) which i can use in b4j with a jdbc driver that i found. So my question is, sithaso webapp or b4j app?

It is mandatory to use this sqlitecihper database for security reasons and because b4a app using same database.

Thank you for your time.
 

Mashiane

Expert
Licensed User
Longtime User
i would like to know if i can use an sqlite database
Hi

Yes, one can use SQLite with SithasoDaisy. We are currently doing this with a SQLite Webserver called Pocketbase. This is an example of one of the apps we have done.


One is able to install the server and then set it up.



This can be installed on...



And has an admin interface...




This is the approach we recommend, and there is no PHP involved at all here.

sqlitecipher

We have not yet explored this.
 

MichalK73

Well-Known Member
Licensed User
Longtime User
As far as I know sqlitecipher is probably not supported in B4J only in B4A. There is a commercial SQLite for b4j but you have to pay for it and not a small amount of money.
I suggest you in the backend to the API server to use the H2 database which is described in the forum and it has full full on-the-fly AES encryption.
You must simply transfer the structure from sqlitecipher to H2 and create a connection to the H2 database. That is all.
 

yiankos1

Well-Known Member
Licensed User
Longtime User
As far as I know sqlitecipher is probably not supported in B4J only in B4A. There is a commercial SQLite for b4j but you have to pay for it and not a small amount of money.
It is easier than you thought to connect to SQLcipher. You can use this post in order to CRUD an encrypted sqlite database. Your's and Mashiane's solution sounds interesting. But, my question is, if i can get data using jSQL library at B4J app, can i use them with sithaso?

Sorry if my question is quite silly, but i am new to this framework. I got experience only in B4X products....
 

MichalK73

Well-Known Member
Licensed User
Longtime User
Shitaso is a framework that builds a web application that runs on the client side in a browser in JS. To retrieve data from the database you need to use a connection to the server written in e.g. B4J as a CRUD API. The database server is a matter of connecting to which database you want. So in Shotaso you do not use SQLite but the server side API.
You wrote that the requirement is that you have the data encrypted in the database. Pure MySql, SQLite or pocketbas (sqlite) do not have encrypted information. So if you want a fully encrypted database, you have to use a database that offers this. So there are paid connections to SQLite commercial for a fee or as I wrote you can use the H2 database which is free and has built in full encryption of data on the fly.
https://www.h2database.com/html/main.html
 

Mashiane

Expert
Licensed User
Longtime User
if i can get data using jSQL library at B4J app, can i use them with sithaso?
Is this data going to be called via a rest api approach? If so, yes that can be done.

I am currently testing the BANanoServer implementation with SithasoDaisy. This enables one to use any b4j library in their apps.

We have not done any db stuff yet but hope we can soon.




The PocketBase implementation uses a rest api approach to get the data from the server and make it accessible client side.
 

Mashiane

Expert
Licensed User
Longtime User
Please add this possibility
Exporting DataTable to PDF & Excel (csv & xls)
tnx
For now you can generate ms word reports. Please see these two posts.


 

sdleidel

Active Member
Licensed User
Longtime User
SithasoDaisy the last update give the following
Error:

Compile in debug Mode give this error:

shell\src\b4j\example\sduitable_subs_0.java:9981: error: code too large for try statement
catch (Exception e) {...
 

sdleidel

Active Member
Licensed User
Longtime User
Next Problem.
If I add a "Select Field" to the Table and then pass a list for the "Select Field", the list is sorted.
Can you change that. I need the order from the list.

Example List
"5 woeio"
"100 cvxvxc"
"2.000 cvxvcv"

The "Select Filed" shows:
"100 cvxvxc"
"2.000 cvxvcv"
"5 woeio"

I need this change very quick )-:
Can you help me ?
 

sdleidel

Active Member
Licensed User
Longtime User
OK i have fix it myself...


1:
Dim options1 As Map = SDUIShared.ListToSelectOptions(optionen_Bestellmenge.get(u))

mdlSDUITable.SetSelectMapItemsOfRow("auflagen_bestellung",u, options1)

The Problem is in SetSelectListItemsOfRow, you use SDUIShared.ListToSelectOptionsSort(options)
 

giannimaione

Well-Known Member
Licensed User
Longtime User
what a difference and how to use this
B4X:
    SDUITable1.ClearPropertyBag
    SDUITable1.AddColumnTextBox("qta", "Quantità", False) 'edit on table
    SDUITable1.AddColumn("codice", "Codice")
and ...
B4X:
    SDUITable1.SetColumnComputeValue("qta", "subqta") 'ok event "subqta"
or
B4X:
    SDUITable1.SetColumnClass ("qta", "subqta") 'no event "subqta"

and how to define
B4X:
sub subqta (map1 as map)
'ok only on SDUITable1.SetColumnComputeValue
'here there are ALL rows of SDUITable (!?!?!)
end sub

how to intercept event at change value on "qta ColumnTextBox" (only one rows)
 

Mashiane

Expert
Licensed User
Longtime User
SDUITable1.ClearPropertyBag

This is used for the propertybag ONLY, you CANNOT call any .AddColumn statement after this. The property bag works like the preference dialog here in b4x.

If you want to use a property bag, see the example and source in the demo example from your download.

Open, https://sithasodaisyui.netlify.app/, goto Tables - Designer > AD PropertyBag.



This shows you how to define a property bag (left side is the property bag) + right side is the code to create it.

 

Attachments

  • 1686828175243.png
    10.5 KB · Views: 108
Cookies are required to use this site. You must accept them to continue using the site. Learn more…