B4J Question [ABMaterial][Solved]Error upon adding ABMTable

Philip Chatzigeorgiadis

Active Member
Licensed User
Longtime User
I have an ABMaterial app with 50+ pages. Most of the pages use ABMTables to show data.
I have added a new simple page with only a label and a table (bas file attached).
When the table is added in ConnectPage:

B4X:
public Sub ConnectPage()

    Dim lblData As ABMLabel
    lblData.Initialize(page,"lblData","",ABM.SIZE_H5,False,"DataLabel")
    page.Cell(1,1).AddComponent(lblData)

    Dim atable As ABMTable
    atable.Initialize(page,"atable",False, False, True,"tbltheme")
    page.Cell(2,1).AddComponent(atable)  
   
    ' refresh the page
    page.Refresh
    ' Tell the browser we finished loading
    page.FinishedLoading
    ' restoring the navigation bar position
    page.RestoreNavigationBarPosition 'used to be in the depreciated Page_Ready() event!
End Sub

then the following error is shown in Chrome console. I have no other code to manipulate or add data to the table.
If i remove the page.Cell(2,1).AddComponent("atable"), no error is shown.

B4X:
VM212:3 Uncaught TypeError: $(...).inputmask is not a function
    at eval (eval at b4j_eval (core.4.38.min.js:1), <anonymous>:3:30)
    at b4j_eval (core.4.38.min.js:1)
    at x.<anonymous> (core.4.38.min.js:1)
    at x.dispatchEvent (core.4.38.min.js:1)
    at WebSocket.<anonymous> (core.4.38.min.js:1)
 

Attachments

  • JobMain.zip
    4.1 KB · Views: 195

Philip Chatzigeorgiadis

Active Member
Licensed User
Longtime User
Update:
I created a new page, by copy-pasting another page (which uses an ABMTable) that already works OK.
I only changed the name of the page to differentiate it from the original.
The original page works fine.
The new page shows this error.
I tried clearing the cache, Ctrl-F5, running in Debug mode and Tools->Clear Project. No luck.
 
Upvote 0

Philip Chatzigeorgiadis

Active Member
Licensed User
Longtime User
Have you also added the new page in AppStart?

Something like:
B4X:
Dim ExecP0101 As PageExecutor0101
ExecP0101.Initialize
...
myApp.AddPage(ExecP0101.page)
Of course.
I can access the new page normally.
Actually, the table is populated with data and the normal table cell theme is shown.
However, when clicking on the table the active cell theme is not shown (which was initially what triggered me to check the Chrome console for errors).
Furthermore, the table clicked event sub is not executed and GetActiveRow returns null.
All this functionality works fine in the original page, from which I copy-pasted to the new page.
Note that the Chrome console error appears when adding the table in ConnectPage - not when clicking on the table.
If no table is added in the page, no console error appears.
 
Last edited:
Upvote 0

Philip Chatzigeorgiadis

Active Member
Licensed User
Longtime User
Issue is resolved.
Although, as I mentioned in Post #2 above, I had already tried to run in Debug mode with no luck, I followed your advice and checked the .needs file.
Indeed, there was no entry for the new page.
I tried running in Debug mode once again, but still no entry appeared in the .needs file.
I removed the page from the B4J project and then re-added it. Compiled again in Debug mode - again no entry in .needs file.
Obviously, something was prohibiting the .needs file to be written with new data.
I assumed that the file might have been left open for some reason, so I rebooted my PC.
Compiled in Debug mode and this time the entry appeared in the .needs file.
The page now works fine - full functionality and no console error.

If my assumption is correct (i.e. that there was a problem in writting the .needs file) then, perhaps, there could be an indication during compilation of this failure to write the file with new entries (if there is already such an indication, I have missed it).

In any case, Alain, thanks for pointing me in the right direction one more time!
 
Upvote 0
Top