Banano and B4J

@Alwaysbusy

I’m gonna start testing your Banano library for a web app I have on the steps, a rather large system for hotels and lodging.

How easy is it to integrate javascript components like fullcalendar.io?
I need a timeline scheduler for my project, and this component has a nice one.

I also am guessing that to access a database, you need to do this via a REST Api?

/Ronny

@Varandor

Sure. Adding components is easy in BANano using the CustomView. Here is a demo to get you started (the component has a lot of features, so this is just a basic example). If you have problems implementing a certain part of their API, let me know. I here use a BANanoFetch to get the events from a static json file, but this can be from a REST Api call too.

http://gorgeousapps.com/CalendarDemo.zip

Alwaysbusy

Thank you @Alwaysbusy, what files do I use from the fullcalendar download? Seems you
added theese:

BANano.Header.AddCSSFile("calendar.min.css")
BANano.Header.AddJavascriptFile("calendar.min.js")
BANano.Header.AddJavascriptFile("locales-all.min.js")

But I cant find them anywhere. I have donwloaded the fullcalendar from github.

Sorry, just trying to get my head around how this works :innocent:

They are in the zip in the folder /Files. I just renamed the main.min.js and main.min.css files from the download with the prefix calendar because ‘main’ sounded weird :wink:

oh, blind I guess :slight_smile:

but, I get a blank screen when I try to run this

Are you running it on a WebServer? (not by just opening the .html file from disk from your browser, that does not work as a fetch does require a webserver).

Easiest I found is running this plugin in your chrome Browser for testing:

In Chrome, Press F12 to bring up the Dev console to give you a clue what went wrong (post a screenshot maybe)

not running a web server no, will do that ASAP :slight_smile:

Still, it is weird that you get a blank page. This is what I get when I double click on the .html file:

What do you see when you check the console and network tab in Chrome? Maybe I forgot something in the zip :thinking:

Do you see errors from the BANano transpiler in the logs in B4J?

blank bage in chrome webserver to, se images:

B4J log:

network tab:

The B4J logs show a lot of BANano transpiler errors.

The only thing I can think of is that you are not using the latest BANano libraries:

image

Latest version of BANano: http://gorgeousapps.com/BANano6.11.zip

Looks fine. Real puzzle but we will get there

In your logs I see missing CSS and JS files too. Can you copy the complete log in a .txt file? And maybe run in Debug mode instead of Release.

image

It looks like it just does not find the BANanoSkeleton library (is it in the B4J Additional Libraries folder?)

ha, it wokrs in debug mode :open_mouth:

and I moved the skeleton library to the additional libraries insted of B4j libraries

Ok, now retry it in release mode. If it does not work, send me the complete logs.

That is going to be it probably. BANanoLibraries need to be there, not in the main B4J Libraries folder. That is the place where the Transpiler looks for them.

yesss, works in both modes now :slight_smile: thank you so far :slight_smile:

Cool! I’ll add an entry in the BANano download section on the B4J forum about where BANanoLibraries have to be placed.

EDIT, it was there in the Getting Started section but I’ve put it in bold :wink:

1 Like

maybe a dumb question, but can I use databases like in abmaterial, or du I have to have an api for that?

You can use a database in the browser’s Local Storage (BANanoSQL) that allows you to use SQL queries like this:

SQL.OpenWait("SQL", "bananodb")
 
SQL.ExecuteWait("CREATE TABLE IF NOT EXISTS flights (flightNo INT, fromCity STRING, toCity STRING, isInTheAir BOOL)", Null)
Dim ret As List = SQL.ExecuteWait("SELECT COUNT(*) AS myCount FROM flights;", Null)
Dim MyCount As Int = SingleResult(ret, "myCount")
Log("MyCount Before: " & MyCount)
MyCount = MyCount + 1
SQL.ExecuteWait("INSERT INTO flights (flightNo, fromcity, toCity, isInTheAir) VALUES (?, ?, ?, ?)", Array(MyCount, "Brussels", "Paris", True))

for more info:

There is also a BANanoLibrary on the forum here that uses php to connect with MySQL and other databases.

ok, thanks