Besides the "normal webapps", with BANanoServer, you are also able to create jetty websocket based webapp, and Alain has "promised" us a lot of exciting things with B7. Cant wait..so it's not creating a server that provides the HTML to the client (that must be mostly written outside b4j) and handles all requests/responses from the client
Front-end (Browser): BANano -> independent html/css/js. All the logic and UI is written in plain B4J and the Abstract Designer + the special BANano commandsok so the b4j project will compile and create for me the html/css/js files and they will run independently.
so it's not creating a server that provides the HTML to the client (that must be mostly written outside b4j) and handles all requests/responses from the client like for example NodeJS? or is that also possible?
public Sub SendRegistrationsWait()
Dim Results As List
Results = SQL.ExecuteWait($"SELECT dtitscan, dtgrpscan, dtid, dttype, dtdatetime, dtstop, dtstart, dtextra FROM tData WHERE dtstatus=2"$, Null)
If Results.Size = 0 Then
SKTools.ShowToast("Niets om door te sturen", "info", 3000, True)
Return
End If
Dim now As Long = DateTime.Now
Dim RecList As List
RecList.Initialize
For i = 0 To Results.Size - 1
Dim dataSend As Map
dataSend.Initialize
Dim m As Map = Results.Get(i)
Dim resM As Map
resM.Initialize
resM.Put("ic", m.Get("dtitscan"))
resM.Put("gc", m.Get("dtgrpscan"))
resM.Put("va", 0)
resM.Put("ri", m.Get("dtid"))
resM.Put("rt", m.Get("dttype"))
RecList.Add(resM)
Next
dataSend.Put("da", RecList)
dataSend.Put("tp", 100)
Dim fetch As BANanoFetch
Dim fetchOptions As BANanoFetchOptions
Dim fetchResponse As BANanoFetchResponse
Dim data As Map
Dim Error As String
Dim JsonG As BANanoJSONGenerator
JsonG.Initialize(dataSend)
fetchOptions.Initialize
fetchOptions.Method = "POST"
fetchOptions.Body = JsonG.ToString
fetchOptions.Headers = CreateMap("Content-type": "application/json; charset=UTF-8", "api_key": APIKey)
fetch.Initialize("https://api.xxxxxxxxxxxxxxxxxx/v1/registration/uploadxxxxxxxxxxx", fetchOptions)
fetch.Then(fetchResponse)
' we got a response, but as the Json() method returns a Promise, we will need to process it in the next 'then' so we return it to this Fetch
fetch.Return(fetchResponse.Json)
fetch.ThenWait(data)
If data.get("status") = "OK" Then
SQL.ExecuteWait($"UPDATE tData SET dtstatus=99 WHERE dtstatus=2"$, Null)
SKTools.ShowToast("Alles doorgestuurd.", "info", 3000, True)
Else
SKTools.ShowToast("Doorsturen niet gelukt.", "info", 3000, True)
End If
fetch.ElseWait(Error)
SKTools.ShowToast(Error, "info", 3000, True)
fetch.End
End Sub
Sub Class_Globals
Private BANano As BANano 'ignore
Dim LogOut As BANanoAutoElement ' has id="logout" in the tag (lowercased!)
Dim TableLine As BANanoAutoElement ' has data-banevent="tableline" in the tag (lowercased!)
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize()
End Sub
' router path /testPage1
Sub BANano_RouterHandle(url As String, data As Map, params As Map)
Log(url)
Main.router.LoadHTML("home.html")
' note that we have done nothing to initialize LogOut with the html tag with id="logout"
Log(LogOut.GetText)
End Sub
' you have nothing special to do to make these events work
Sub Logout_Click(event As BANanoEvent)
BANano.Alert("Hi, are you sure?!")
End Sub
Sub TableLine_Click(event As BANanoEvent)
Dim tmpLine As BANanoElement = Sender
Log(tmpLine.GetText)
End Sub
Sub BANano_RouterLeaving() As Boolean
Log("Do some checks Page 1")
Return True
End Sub
Wow! This makes it easier I see for anyone who can just find any template they like on the web and "plug and play", irrespective of framework - except ReAct/Angular/Vue of course. Wow, awesome stuff, I love the options you are bringing, congrats!This will be called in BANano a BANanoAutoElement
Indeed, this was a feature request I had see passing by a couple of times. They will not be able to use and take advantage of the Abstract Designer like with your library and will have to write their HTML manually, but it would be an extra option available.I see for anyone who can just find any template they like on the web and "plug and play"
Perhaps its a good thing, besides, i have received request to also add functionality to built UI just by coding. There was also a request here in the forum in support of full app coding without even using the abstract designer, in support of people who cant use such tools.They will not be able to use and take advantage of the Abstract Designer
True, Microsoft "copied" Blocky from Google for such purposes and then killed it. Yes I guess for kids and stuff, it could be useful to teach them the basics, but for anyone looking for pure productivity, other tools will do the job.I have tried these visual programming systems, they slow down the coding a lot and in any case you always have to write to parameterize the functions.
Good for teaching programming not good at professional levels
That sounds like a good idea! I see if I can recreate all of them for v7.having a collection of Erel's WebApps created with B4ANano
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?