jayel Active Member Licensed User Longtime User Oct 4, 2016 #1 Can this button fire a clicked event? I supposed it could : Code: 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) Code: 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 Click to expand... Am I doing something wrong?
Can this button fire a clicked event? I supposed it could : Code: 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) Code: 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 Click to expand... Am I doing something wrong?
Mashiane Expert Licensed User Longtime User Oct 5, 2016 #2 To trap the main button click event, found this on the demo example.. Code: 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... Upvote 0
To trap the main button click event, found this on the demo example.. Code: 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...
jayel Active Member Licensed User Longtime User Oct 6, 2016 #3 No, I set I breakpoint and the event doesn't get fired, anybody else? PS Mashiane said: also your button event is btnOpslaan1 while the button is defined as "btnOpslaan" in the initialize event. perhaps correct that and see what happens... Click to expand... Code: btnaction1.Initialize(page,"btnOpslaan" & counter,"mdi-content-save","red") Notice the counter after btnopslaan, it is a counter that starts with1, so the first buttoin would be btnOpslaan1, second btnOpslaan2, etc ... Upvote 0
No, I set I breakpoint and the event doesn't get fired, anybody else? PS Mashiane said: also your button event is btnOpslaan1 while the button is defined as "btnOpslaan" in the initialize event. perhaps correct that and see what happens... Click to expand... Code: btnaction1.Initialize(page,"btnOpslaan" & counter,"mdi-content-save","red") Notice the counter after btnopslaan, it is a counter that starts with1, so the first buttoin would be btnOpslaan1, second btnOpslaan2, etc ...
alwaysbusy Expert Licensed User Longtime User Oct 6, 2016 #4 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. Upvote 0
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.
jayel Active Member Licensed User Longtime User Oct 6, 2016 #5 alwaysbusy said: 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. Click to expand... No the above doesn't work I get this in the google console window Uncaught ReferenceError: actionbuttonclickarray is not defined Click to expand... Upvote 0
alwaysbusy said: 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. Click to expand... No the above doesn't work I get this in the google console window Uncaught ReferenceError: actionbuttonclickarray is not defined Click to expand...
alwaysbusy Expert Licensed User Longtime User Oct 6, 2016 #6 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 Upvote 0
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
jayel Active Member Licensed User Longtime User Oct 6, 2016 #7 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? Upvote 0
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?
alwaysbusy Expert Licensed User Longtime User Oct 6, 2016 #8 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. Upvote 0
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.
jayel Active Member Licensed User Longtime User Oct 6, 2016 #9 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? Upvote 0
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?
Mashiane Expert Licensed User Longtime User Oct 6, 2016 #10 Do you perhaps mean when you run on the dropdown its "Debug" and not in "Release" mode, just curious.. Upvote 0
Do you perhaps mean when you run on the dropdown its "Debug" and not in "Release" mode, just curious..
alwaysbusy Expert Licensed User Longtime User Oct 6, 2016 #12 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). Upvote 0
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).
jayel Active Member Licensed User Longtime User Oct 6, 2016 #14 Simple solution, don't run in debug mode ! Thx for the help ! Solved ! Upvote 0