Android Question [B4X] B4XComboBox - Is it possible to force dropdown from code?

MrKim

Well-Known Member
Licensed User
Longtime User
That's it. I know I could use a text view and listview to do this - but dropdown would be simpler.
 

MrKim

Well-Known Member
Licensed User
Longtime User
B4X:
B4XComboBox1.cmbBox.As(JavaObject).RunMethod("performClick", Null)
In B4J this line causes the following error - not yet tested in B4i:
B4X:
*** pagesubmittoqc: B4XPage_Appear [pagepicklogout]
Error occurred on line: 251 (SubmitToQCPage)
java.lang.RuntimeException: Method: performClick not found in: javafx.scene.control.ComboBox
    at anywheresoftware.b4j.object.JavaObject$MethodCache.getMethod(JavaObject.java:363)
    at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:120)
    at b4j.example.submittoqcpage._qtytosubmittb_focuschanged(submittoqcpage.java:930)
    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:629)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at jdk.internal.reflect.GeneratedMethodAccessor3.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:111)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
    at anywheresoftware.b4j.objects.NodeWrapper$8.changed(NodeWrapper.java:187)
    at anywheresoftware.b4j.objects.NodeWrapper$8.changed(NodeWrapper.java:1)
    at javafx.base/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:360)
    at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
    at javafx.base/javafx.beans.property.ReadOnlyBooleanPropertyBase.fireValueChangedEvent(ReadOnlyBooleanPropertyBase.java:72)
    at javafx.graphics/javafx.scene.Node$FocusedProperty.notifyListeners(Node.java:8154)
    at javafx.graphics/javafx.scene.Scene$12.invalidated(Scene.java:2194)
    at javafx.base/javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
    at javafx.base/javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
    at javafx.graphics/javafx.scene.Scene$KeyHandler.setFocusOwner(Scene.java:4058)
    at javafx.graphics/javafx.scene.Scene$KeyHandler.requestFocus(Scene.java:4105)
    at javafx.graphics/javafx.scene.Scene.requestFocus(Scene.java:2161)
    at javafx.graphics/javafx.scene.Node.requestFocus(Node.java:8315)
    at javafx.controls/com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior.show(ComboBoxBaseBehavior.java:282)
    at javafx.controls/com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior.mouseReleased(ComboBoxBaseBehavior.java:240)
    at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
 
Upvote 0
Top