Can this button fire a clicked event?
I supposed it could :
B4X:
Dim btnaction1 As ABMActionButton
btnaction1.Initialize(page,"btnOpslaan" & counter,"mdi-content-save","red")
btnaction1.MainButton.size = ABM.BUTTONSIZE_LARGE
Tabc.Cell(1,2).AddComponent(btnaction1)
B4X:
Sub btnOpslaan1_Clicked(Target As String, SubTarget As String)
Dim mykraan As kraan
mykraan = Main.Kranen.Get(0)
Log(mykraan.MachineNaam)
Dim mytab As ABMTabs = page.Component("tabs")
Dim mytabcontainer As ABMContainer = mytab.GetTabPage("tab1")
Dim commid As ABMInput = mytabcontainer.Component("txtcommid1")
Dim id As ABMInput = mytabcontainer.Component("txtid1")
Dim combotype As ABMCombo = mytabcontainer.Component("cmdtype1")
Dim checkcontrole As ABMCheckbox = mytabcontainer.Component("chkcontrole1")
Dim produktomschrijving As ABMInput = mytabcontainer.Component("txtproduktomschrijving1")
End Sub
But the event doesn't fire :
My console log says :
(index):1 Uncaught ReferenceError: actionbuttonclickarray is not defined
To trap the main button click event, found this on the demo example..
B4X:
If SubTarget="" Then
Log("clicked main button")
Return
End If
Then you can put your code inside that if statement...
also your button event is btnOpslaan1 while the button is defined as "btnOpslaan" in the initialize event. perhaps correct that and see what happens...
also your button event is btnOpslaan1 while the button is defined as "btnOpslaan" in the initialize event. perhaps correct that and see what happens...
It is possible that you need to refresh (F5) in the browser or/and increase the AppVersion in ABMShared as it looks like the needed libs are not loaded.
If nothing helps, try adding page.NeedsActionButton=true in the BuildPage() method to force to load the libraries needed for an ABMActionButton.
It is possible that you need to refresh (F5) in the browser or/and increase the AppVersion in ABMShared as it looks like the needed libs are not loaded.
If nothing helps, try adding page.NeedsActionButton=true in the BuildPage() method to force to load the libraries needed for an ABMActionButton.
Then it must definitely mean your html/js/css is cached somehow. The 'actionbuttonclickarray' will be written in the generated .js file when page.NeedsActionButton = true.
open in the www, your app folder, your page folder, the .js file in e.g. notepad++ and search for 'function actionbuttonclickarray', it should be there.
Open in in chrome, press F12, in NetWork click 'disable cache', press F5
No the 'function actionbuttonclickarray' is NOT found in my js folder.
Even with 'disable cache' it doen't fire the event
Is it because I use a raspberry pi for debugging, do I have to manualy copy files when I want to debug?
Then you do not have the most recent generated www files on you Pi. How do you mean 'debugging on Pi'? The B4J IDE does only run on Windows, no? So every time you click 'run' in the IDE, a new set of the www folder is generated on the PC. So at that time this is still on your PC, not on the Pi. You'll need to upload this new www folder to the Pi then. And the .needs file too.
I mean, I connect the B4J program with my py (remote debugging).
I press "Run" so I suppose the B4J will copy all the files for me? NO?
So everytime I want to debug (run) my app I have to kopie the www folder manually?
Didn't even know that was possible. But yes, in that case B4J does not copy the new www folder to the PI (not an ABMaterial limitation, but just how B4J works).