B4J Tutorial [ABMaterial/BANano] Making BANano Libraries for ABMaterial

alwaysbusy

Expert
Licensed User
Longtime User
VERY IMPORTANT!

Do NOT use version 6.57, but the new version 6.59!

1. [FIX] ABMBANano Libraries losing Websocket connection
--------------------------------------------------------
I had to find this out myself the hard way, but there was a major flaw in the generation of the 'glue' code:
It only worked for ONE instance of the page. So as soon as two or more users accessed the page, the previous ones broke the connection.

You will have to recompile your existing ABMBANanoLibraries with this new version and make the changes in the calling ABM app described below:

Consequences on this fix:

a. Step 3. (Call this method in ConnectPage() to set the WebSocket) has to be removed
b. In each call to an ABMBANano library in ABM, you must pass the WebSocket (ws) in the method as the first parameter.

Alwaysbusy
 

Cableguy

Expert
Licensed User
Longtime User
What about the Authoring properties, did you manage to add them?
 

Cableguy

Expert
Licensed User
Longtime User
#24 post only mentions the websocket bug fix, and in the ordinal post I only found the very few code changes regarding this new version. (Found it!!)
Anyway, Thank You
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
Hi Alain,

I was about to recompile the Hover BananoLib and noticed that you forgot to update the Hover Class example code to reflect the changes in 6.59.

The Initialize(ws, "myJS") and AddHover(ws, "button") declarations are still in the old schema. Also, the "ws" part of the code in that class is missing.
I'm guessing this is an important part to develop these libraries.
 

alwaysbusy

Expert
Licensed User
Longtime User
You don have to make any changes in the method definitions of you BANano class. The 'ws as WebSocket' is automatically injected in the 'glue' code when you run BANano.BuildAsB4XlibForABM().

When you run this method, you will notice in the log it shows 'Export: YourMethodName(ws as WebSocket, YourParams...)

Alwaysbusy
 

Cableguy

Expert
Licensed User
Longtime User
You don have to make any changes in the mehod definitions of you BANano class. The 'ws as WebSocket' is automatically injected in the 'glue' code when you run BANano.BuildAsB4XlibForABM().
Ok, but in ABMaterial, when I start typing the methods, it still has the old defenition.... Do I need to first delete the previously created lib?
 

Cableguy

Expert
Licensed User
Longtime User
Well, refreshing may help...
Just browsed the extralibs folder and found that the lib files were NOT overwritten with the new ones...
So I just deleted them and recompiled.... The logs state, as it should, that the extra libs folder is found, but nothing gets added there.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…