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)
 
Top