Y ykucuk Well-Known Member Licensed User Longtime User May 9, 2024 #1 I have a panel (b4xview) that functions correctly in debug mode but not in release mode; it's a simple click panel with no special libraries involved. Can anyone suggest why this might be happening and how to resolve the issue? Code: Copy Sub CasePanel_Click MyApp.Initialize Dim bt As B4XView =Sender Log(bt.Tag) Wait For ( MyApp.GetCaseDetail("&CaseID="& bt.Tag &"&")) Complete (CaseDetail As Map) Error b4xmainpage$ResumableSub_CasePanel_Clickresume (java line: 984) java.lang.RuntimeException: Object should first be initialized (B4XView). Attachments Screenshot 2024-05-08 at 6.40.13 PM.png 233 KB · Views: 520
I have a panel (b4xview) that functions correctly in debug mode but not in release mode; it's a simple click panel with no special libraries involved. Can anyone suggest why this might be happening and how to resolve the issue? Code: Copy Sub CasePanel_Click MyApp.Initialize Dim bt As B4XView =Sender Log(bt.Tag) Wait For ( MyApp.GetCaseDetail("&CaseID="& bt.Tag &"&")) Complete (CaseDetail As Map) Error b4xmainpage$ResumableSub_CasePanel_Clickresume (java line: 984) java.lang.RuntimeException: Object should first be initialized (B4XView).
jahswant Well-Known Member Licensed User Longtime User May 9, 2024 #2 B4X: Copy Sub CasePanel_Click Dim bt As B4XView =Sender 'Always first here. MyApp.Initialize Log(bt.Tag) Wait For ( MyApp.GetCaseDetail("&CaseID="& bt.Tag &"&")) Complete (CaseDetail As Map) Upvote 0
B4X: Copy Sub CasePanel_Click Dim bt As B4XView =Sender 'Always first here. MyApp.Initialize Log(bt.Tag) Wait For ( MyApp.GetCaseDetail("&CaseID="& bt.Tag &"&")) Complete (CaseDetail As Map)
DonManfred Expert Licensed User Longtime User May 9, 2024 #3 Where is the project showing the problem? Upvote 0
peacemaker Expert Licensed User Longtime User May 9, 2024 #4 It is simple. In fast working Release mode your Sender is not initialized on time. Why ? It is a second question. Upvote 0
It is simple. In fast working Release mode your Sender is not initialized on time. Why ? It is a second question.
Y ykucuk Well-Known Member Licensed User Longtime User May 9, 2024 #5 jahswant said: B4X: Copy Sub CasePanel_Click Dim bt As B4XView =Sender 'Always first here. MyApp.Initialize Log(bt.Tag) Wait For ( MyApp.GetCaseDetail("&CaseID="& bt.Tag &"&")) Complete (CaseDetail As Map) Click to expand... doesn't help Upvote 0
jahswant said: B4X: Copy Sub CasePanel_Click Dim bt As B4XView =Sender 'Always first here. MyApp.Initialize Log(bt.Tag) Wait For ( MyApp.GetCaseDetail("&CaseID="& bt.Tag &"&")) Complete (CaseDetail As Map) Click to expand... doesn't help
Y ykucuk Well-Known Member Licensed User Longtime User May 9, 2024 #6 DonManfred said: Where is the project showing the problem? Click to expand... I can't upload project here. Maybe just that B4xPage works ? Upvote 0
DonManfred said: Where is the project showing the problem? Click to expand... I can't upload project here. Maybe just that B4xPage works ?
Y ykucuk Well-Known Member Licensed User Longtime User May 9, 2024 #7 I think its related with BBCodeView in panel layout. Upvote 0
Jeffrey Cameron Well-Known Member Licensed User Longtime User May 9, 2024 #8 I had an intermittent issue like this in a project. I ended up adding an "Initialization_Complete" event to my class that it raises once it's done with startup and I wait for that after initializing it before continuing. Upvote 0
I had an intermittent issue like this in a project. I ended up adding an "Initialization_Complete" event to my class that it raises once it's done with startup and I wait for that after initializing it before continuing.
Y ykucuk Well-Known Member Licensed User Longtime User May 9, 2024 #9 Jeffrey Cameron said: I had an intermittent issue like this in a project. I ended up adding an "Initialization_Complete" event to my class that it raises once it's done with startup and I wait for that after initializing it before continuing. Click to expand... Can you help me about Initialization_Complete . it can solve my issue Upvote 0
Jeffrey Cameron said: I had an intermittent issue like this in a project. I ended up adding an "Initialization_Complete" event to my class that it raises once it's done with startup and I wait for that after initializing it before continuing. Click to expand... Can you help me about Initialization_Complete . it can solve my issue
Jeffrey Cameron Well-Known Member Licensed User Longtime User May 9, 2024 #10 Without seeing your code I cannot really speak to your exact issue or methodology. In my case, I pass the instantiating activity to the class and then call back to it when finished. The activity code basically looks like: Code: Copy ... MyClass.initialize(Me) Wait for (MyClass.Startup(Parm1, Parm2)) Initialization_Complete (Success as Boolean) ... ' more code Wait For (MyClass.NextFunction(Parm1, Parm2)) Complete (Result as boolean) ..... ' and so on The MyClass class saves the passed-in activity to a "myCaller" variable and uses it to callsub back as necessary, for example Code: Copy ... 'doing some initial stuff, now all done CallsubDelayed(myCaller, "Initialization_Complete", True) Upvote 0
Without seeing your code I cannot really speak to your exact issue or methodology. In my case, I pass the instantiating activity to the class and then call back to it when finished. The activity code basically looks like: Code: Copy ... MyClass.initialize(Me) Wait for (MyClass.Startup(Parm1, Parm2)) Initialization_Complete (Success as Boolean) ... ' more code Wait For (MyClass.NextFunction(Parm1, Parm2)) Complete (Result as boolean) ..... ' and so on The MyClass class saves the passed-in activity to a "myCaller" variable and uses it to callsub back as necessary, for example Code: Copy ... 'doing some initial stuff, now all done CallsubDelayed(myCaller, "Initialization_Complete", True)