B4J Question Object should be initialized (ScrollPane)

Sergio83

Active Member
Licensed User
Longtime User
Hello everybody,
I'm facing a run time error regarding ScrollPane use.

I've defined a ScrollPane with the designer which created the statement in class_global section

B4X:
Private SV_nicknames As ScrollPane

I initialize this ScrollPane in the b4xpage_appear sub

B4X:
SV_nicknames.SetVScrollVisibility("ALWAYS")
SV_nicknames.LoadLayout("ScrollPane.bjl", 0, 0)
pnl_item_node_nicknames=SV_nicknames.innernode

At run time I get this error (line 1 of blok above) :

B4X:
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
b4xpage_accueil$ResumableSub_b4xpage_appear.resume (java line: 766)
java.lang.RuntimeException: Object should first be initialized (ScrollPane).
    at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:49)
    at anywheresoftware.b4j.objects.ScrollPaneWrapper.SetVScrollVisibility(ScrollPaneWrapper.java:134)
    at serisyvis.gestenv.b4xpage_accueil$ResumableSub_b4xpage_appear.resume(b4xpage_accueil.java:766)
    at serisyvis.gestenv.b4xpage_accueil._b4xpage_appear(b4xpage_accueil.java:742)
    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:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
    at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:514)
    at anywheresoftware.b4a.keywords.Common.access$0(Common.java:494)
    at anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.run(Common.java:568)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    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:834)
java.lang.NullPointerException

I have other B4J app where I use ScrollPane with the same statements and I've no run time error.

I've searched the forum and Google with no success.

Could some one of you help me to fix this issue.

Thanks to you by advance
 

Sergio83

Active Member
Licensed User
Longtime User
Hello Don,
This project is an app for management of finger print sensors.
Here is the upload
 

Attachments

  • GESTFP.zip
    79.9 KB · Views: 104
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
The view you are referring to (SV_capteurs) it's in the layout "pnlgestcapteur".
But in the B4XMainPage you load the "accueil" layout.
So the view it's not present.
At least at a first fast look.
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Anyway we went out of road, because the question was about another view.
But I got that error first and checked about it.
@Alexander Stolte got it right.
 
Upvote 0

Sergio83

Active Member
Licensed User
Longtime User
Many thanks to all of you.

I thought it was dum and enormous!

Indeed it is ...

Thanks again
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…