B4J Question [Solved] How Sender for SwiftButton? Getting ".Text"

Dadaista

Active Member
Licensed User
Longtime User
Hi

I get this error
B4X:
Ha ocurrido un error en la línea: 1550 (Main)
java.lang.RuntimeException: Type does not match (class anywheresoftware.b4j.objects.PaneWrapper$ConcretePaneWrapper$NonResizePane)
    at anywheresoftware.b4a.objects.B4XViewWrapper.typeDoesNotMatch(B4XViewWrapper.java:573)
    at anywheresoftware.b4a.objects.B4XViewWrapper.getText(B4XViewWrapper.java:324)
    at Caja.Venta.main._btnnum_click(main.java:7559)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at jdk.internal.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:487)
    at anywheresoftware.b4a.keywords.Common.access$0(Common.java:467)
    at anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.run(Common.java:541)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:832)

Where....

B4X:
Sub BtnNum_Click
    Dim btn As SwiftButton = Sender
Dim sCaption As String = btn.mBase.Text '<- Here
    '..........................'

or

B4X:
Sub BtnNum_Click
    Dim btn As SwiftButton = Sender
    'Dim sCaption As String = btn.mBase.Text
    
    Dim ll As B4XView
    
    ll = btn.mBase
    
    Log(ll.Text)' <-Here



How can I solve?
 
Last edited:
Top