DALB Active Member Licensed User Jul 9, 2024 #1 hello, in a B4Xpages, I have this little code: Code: Copy Log("starter.list-----------") For u=0 To Starter.list.Size-1'Starter.list.Size-1 Log("starter.list.get(" & u & ") = " & Starter.list.Get(u)) Next 'list' is declared and initialized in starter module. But when it's running, an error comes with this line: java.lang.RuntimeException: Object should first be initialized (List). Click to expand... But, I code only in B4Xpages. Why this error ? With Activity, I initialize, but here, what can I do ? Something escapes from my reason !!!
hello, in a B4Xpages, I have this little code: Code: Copy Log("starter.list-----------") For u=0 To Starter.list.Size-1'Starter.list.Size-1 Log("starter.list.get(" & u & ") = " & Starter.list.Get(u)) Next 'list' is declared and initialized in starter module. But when it's running, an error comes with this line: java.lang.RuntimeException: Object should first be initialized (List). Click to expand... But, I code only in B4Xpages. Why this error ? With Activity, I initialize, but here, what can I do ? Something escapes from my reason !!!
Alexander Stolte Expert Licensed User Longtime User Jul 9, 2024 #2 DALB said: 'list' is declared and initialized in starter module. Click to expand... Why? DALB said: But when it's running, an error comes with this line: Click to expand... Then check first whether the list has been initialized. Nobody can help you here, because nobody knows what your starter service looks like, how you initialize and fill the list. Upvote 1
DALB said: 'list' is declared and initialized in starter module. Click to expand... Why? DALB said: But when it's running, an error comes with this line: Click to expand... Then check first whether the list has been initialized. Nobody can help you here, because nobody knows what your starter service looks like, how you initialize and fill the list.
DALB Active Member Licensed User Jul 9, 2024 #3 I'll read again the different informations about B4Xpages, the only thing I can't arrive to do is sending datas from a B4Xpages to another. Systematically, I have this error "....not initialized" !!! Thanks for answering. Upvote 0
I'll read again the different informations about B4Xpages, the only thing I can't arrive to do is sending datas from a B4Xpages to another. Systematically, I have this error "....not initialized" !!! Thanks for answering.
B Brian Dean Well-Known Member Licensed User Longtime User Jul 9, 2024 #4 Do you mean that you have created a List object called "list". I cannot check it now but that seems a bad idea. Try calling it something else. Edit : I have had time to check this now - it does seem to work. But I still think that it is bad practice. Last edited: Jul 10, 2024 Upvote 0
Do you mean that you have created a List object called "list". I cannot check it now but that seems a bad idea. Try calling it something else. Edit : I have had time to check this now - it does seem to work. But I still think that it is bad practice.
josejad Expert Licensed User Longtime User Jul 10, 2024 #5 DALB said: I code only in B4Xpages Click to expand... So, as Erel said, there’s no need to use starter service, but B4XMainPage, that’s why Alexander is asking you. And probably Brian is rigth too… using a reserved word as a variable name is not a good idea. Upvote 0
DALB said: I code only in B4Xpages Click to expand... So, as Erel said, there’s no need to use starter service, but B4XMainPage, that’s why Alexander is asking you. And probably Brian is rigth too… using a reserved word as a variable name is not a good idea.
DonManfred Expert Licensed User Longtime User Jul 10, 2024 #6 The threadtitle is wrong. You have NOT added items to this list as the list is not initialized. The problem is somewhere else. Post a small project showing the problem. Upvote 0
The threadtitle is wrong. You have NOT added items to this list as the list is not initialized. The problem is somewhere else. Post a small project showing the problem.