Hi,
I'm trying to use B4JS for handle user input at a login modal. Everything works fine until I try to get the ABMInput component on HandleLogin sub.
When I try to open the Login Modal after handlelogin was executed, the page freezed for a period, and I got an error on Chrome Dev Console and an error and B4J. Eventually after some time the Login Modal shows up.
Chrome Dev Error:
B4J error:
I've identified that the error happens when I try to get the ABMInput (login field): (Line 8 on following code)
If that line is commented problem doesn't happen, but also I can't get user login.
If I don't use B4JS everything works fine. But I would like to use it to handle user input directly on browser without overhead the server.
Attached a small project to reproduce the problem.
Below a video showing the problem:
Thank you very much.
I'm trying to use B4JS for handle user input at a login modal. Everything works fine until I try to get the ABMInput component on HandleLogin sub.
When I try to open the Login Modal after handlelogin was executed, the page freezed for a period, and I got an error on Chrome Dev Console and an error and B4J. Eventually after some time the Login Modal shows up.
Chrome Dev Error:
B4X:
Uncaught TypeError: Cannot read property 'apply' of undefined
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)
(anonymous) @ core.4.38.min.js:1
x.dispatchEvent @ core.4.38.min.js:1
(anonymous) @ core.4.38.min.js:1
B4J error:
B4X:
java.util.concurrent.TimeoutException
at anywheresoftware.b4j.object.WebSocket$SimpleFuture.getValue(WebSocket.java:63)
at com.ab.abmaterial.ABMInput.getVisibility(Unknown Source)
at com.ab.abmaterial.ABMInput.RefreshInternal(Unknown Source)
at com.ab.abmaterial.ABMCell.RefreshInternalExtra(Unknown Source)
...
I've identified that the error happens when I try to get the ABMInput (login field): (Line 8 on following code)
B4X:
public Sub HandleLogin(LoginFromPage As String)
Log(80)
Dim x As ABMModalSheet = page.ModalSheet("login")
If page.ws.Session.GetAttribute2("IsAuthorized", "") = "" Then
Log(90)
'if the next line is commented problem does not happen
Dim y As ABMInput = x.Content.Component("logininp1") '********Here********
End If
' ' user was successful in login. Now navigate to xxx...
page.CloseModalSheet("login")
End Sub
If that line is commented problem doesn't happen, but also I can't get user login.
If I don't use B4JS everything works fine. But I would like to use it to handle user input directly on browser without overhead the server.
Attached a small project to reproduce the problem.
Below a video showing the problem:
Thank you very much.