B4J Question addHandler works in debug but not release mode

Nokia

Active Member
Licensed User
Longtime User
i'v noticed that this code works in debug mode but not in release mode. I'm thinking it has to do with getting getfield(BA) but not sure. not sure what I'm missing?

B4X:
    Dim pwd As JavaObject
    pwd.InitializeNewInstance("javafx.scene.control.PasswordField",Null)
    Dim joMe As JavaObject = Me
    Dim ba As Object = joMe.GetField("ba")
    Me.as(JavaObject).RunMethod("addHandler",Array(pwd, ba, Me))


#If java
import anywheresoftware.b4j.objects.PaneWrapper.ConcretePaneWrapper;
import anywheresoftware.b4a.BA;
import javafx.scene.control.PasswordField;

public static void addHandler(PasswordField pw, BA ba, Object b4xPage){
    pw.textProperty().addListener((obs, oldText, newText) -> {
        ba.raiseEventFromUI(b4xPage, "onpasswordchanged", newText);
    });
}
#End If


Sub OnPasswordChanged(NewPassword As String)
    'called from java code below  
    Dim strength As Int = pg.CalcPwdStrength(NewPassword)
    Log("Strength P: " & strength)
    hp.Value = strength
End Sub
 

b4x-de

Active Member
Licensed User
Longtime User
You have asked a similar question already on Sep, 15th and received answers that suggested to change to a regular text field, set die password field property and add events via designer. It might help to give the instructions already given another try.


 
Upvote 0
Top