B4J Tutorial SithasoDaisy TailwindCSS UI Toolkit: Q & A

Hi there

NB: Where possible, please include a simple project that demonstrates your use case.

Do you have any questions about SithasoDaisy UI Toolkit?

You can shoot it here and we will oblige.

Thanks in advance?


Join on Telegram


Check $5 WebApps

 
Last edited:

Mashiane

Expert
Licensed User
Longtime User
I am not able,
can this code, download my pdf file from website ?
B4X:
SDUIShared.Download("https://www.mywebsite.com/public/pdf/about.PDF", "result.pdf")

or, is there another solution?
This code is a shortcut to download a text file

Try this code (not tested)

B4X:
dim pdfFile As BANanoObject = banano.await(sduishared.FetchAsFile("https://www.mywebsite.com/public/pdf", "about.pdf"))
SDUIShared.DownloadBlob(pdfFile, "result.pdf")
 

giannimaione

Well-Known Member
Licensed User
Longtime User
dim pdfFile As BANanoObject = banano.await(sduishared.FetchAsFile("https://www.mywebsite.com/public/pdf", "about.pdf")) SDUIShared.DownloadBlob(pdfFile, "result.pdf")
a little trick
B4X:
dim myPath = "https://www.mywebsite.com/public/pdf/"
dim myPDF = "about.pdf"
SDUIShared.OpenURLTab(myPath & myPDF) 'open pdf into new page of browser
 

Enrico Fuoti

Active Member
Licensed User
Longtime User
Hello Mashiane,
Is there a way to add and/or retrieve the users avatars in Sithaso from pocketbase?
I couldn't find any example about this.
 

sdleidel

Active Member
Licensed User
Longtime User
Hi, is there a way to adjust the search field of the tables quasi the column of also the buttons in it are of the size?

This does not fit on mobile devices ...

IMG_7393.jpeg
 

Mashiane

Expert
Licensed User
Longtime User
Hi, is there a way to adjust the search field of the tables quasi the column of also the buttons in it are of the size?

This does not fit on mobile devices ...

View attachment 158681
Also instead of using a table for mobile devices, rather use the grid view.

See this example

 

giannimaione

Well-Known Member
Licensed User
Longtime User
bug or my mistake ?

with SDUIMySQLREST
B4X:
Dim myTable as SDUIMySQLREST
myTable.Initialize(......
myTable.ApiKey = modSDPB.Love
myTable.CLEAR_WHERE
myTable.ADD_WHERE_STRING("myField2", myTable.OPERATOR_EQ, stringTOsearch)
banano.Await(myTable.SELECT_WHERE1)
1) stringTOsearch = "AlfaBeta"
log of mysql is correct: Select "id", "myField1", .... .... WHERE ("myField2" = "AlfaBeta") order by ... ...
but
2) stringTOsearch = "Alfa&Beta"
log of mysql is bad: Select "id", "myField1", .... .... WHERE ("myField2" = "Alfa") order by ... ...

my mistake?
 

Mashiane

Expert
Licensed User
Longtime User
bug or my mistake ?

with SDUIMySQLREST
B4X:
Dim myTable as SDUIMySQLREST
myTable.Initialize(......
myTable.ApiKey = modSDPB.Love
myTable.CLEAR_WHERE
myTable.ADD_WHERE_STRING("myField2", myTable.OPERATOR_EQ, stringTOsearch)
banano.Await(myTable.SELECT_WHERE1)
1) stringTOsearch = "AlfaBeta"
log of mysql is correct: Select "id", "myField1", .... .... WHERE ("myField2" = "AlfaBeta") order by ... ...
but
2) stringTOsearch = "Alfa&Beta"
log of mysql is bad: Select "id", "myField1", .... .... WHERE ("myField2" = "Alfa") order by ... ...

my mistake?
I re-read this, your 2 wont work, because remember, this is a REST API, so it translates to URLSearchParams and forms a URL query string. So you need to encode your query perhaps to Alpha%26Beta or something, I am not sure.

Try

B4X:
stringTosearch = BANano.EncodeURIComponent(stringTosearch)
 

sdleidel

Active Member
Licensed User
Longtime User
Collapseview...
Has a problem on the Iphone.
It close not correct.

If you open the 1st one and then try to close it, it won't close until you open the 2nd one...
 

giannimaione

Well-Known Member
Licensed User
Longtime User
where am I going wrong?
1733418615431.png

my code
B4X:
Dim viewmesi As SDUIMySQLREST
'other code
'other code
'other code
    banano.Await(viewmesi.SELECT_WHERE1)
    Dim lstCat As List
    lstCat.Initialize
    Dim lstSer As List
    lstSer.Initialize
    Do While viewmesi.NextRow
        Dim periodo As String = viewmesi.GetString("mese")
        Dim totimporto As Object = viewmesi.GetString("totale_importo")
        lstCat.Add(periodo) 'this is OK
        lstSer.Add(totimporto) 'make a list, but not show
        ''' lstSer.Add((Rnd(12000, 75000)) 'THIS IS OK!!!!!
    Loop
    SDUIToastChart5.AddCategories(lstCat) 'this is OK
    SDUIToastChart5.AddSeries("Importo", lstSer) 'this not show
    SDUIToastChart5.AddSeries("Income", Array(38000, 14000, 7700, 92000, 56000, 43000)) 'this is a yellow line
    SDUIToastChart5.Refresh
 
Last edited:

Mashiane

Expert
Licensed User
Longtime User

giannimaione

Well-Known Member
Licensed User
Longtime User
solved with
B4X:
Dim totimporto As Integer = viewmesi.GetInt("totale_importo")
 

giannimaione

Well-Known Member
Licensed User
Longtime User
i make a form with Visual Designer
there there are several components, and a SDUIToastChart (SDUIToastChart5)
my code:
B4X:
Private Sub ShowChart (param1 As String, param2 As String)
  Dim viewmesi As SDUIMySQLREST
'other code
'other code
'other code
Do While viewmesi.NextRow
'other code
'other code
'other code
Loop
  SDUIToastChart5.AddCategories(lstCat) 'List
  SDUIToastChart5.AddSeries("Importo", lstSer) 'List
  SDUIToastChart5.Refresh
End Sub
on first time,
banano.Await(ShowChart(sPar1, sPar2)
the compement "SDUIToastChart5" is displayed correctly,
but, each time "banano.Await(ShowChart(sPar1, sPar2)" the number of components increases by one on the screen

see image
1733470154810.png

how to "clear" "remove" data from SDUIToastChart ?
 

Mashiane

Expert
Licensed User
Longtime User
i make a form with Visual Designer
there there are several components, and a SDUIToastChart (SDUIToastChart5)
my code:
B4X:
Private Sub ShowChart (param1 As String, param2 As String)
  Dim viewmesi As SDUIMySQLREST
'other code
'other code
'other code
Do While viewmesi.NextRow
'other code
'other code
'other code
Loop
  SDUIToastChart5.AddCategories(lstCat) 'List
  SDUIToastChart5.AddSeries("Importo", lstSer) 'List
  SDUIToastChart5.Refresh
End Sub
on first time,
banano.Await(ShowChart(sPar1, sPar2)
the compement "SDUIToastChart5" is displayed correctly,
but, each time "banano.Await(ShowChart(sPar1, sPar2)" the number of components increases by one on the screen

see image
View attachment 159272
how to "clear" "remove" data from SDUIToastChart ?
Please DM me your code module. I need to quickly skim your code, this should not be happening.
 
Top