Hello All,
I am facing a problem while using B4XPages in B4J.
I have two B4XPages.
Page - 1 : List of topics. Where a topic is selected. After selection of topic and click of action button, a map is populated with questions list and passed to page 2 and page 2 is shown.
Page - 2 : In B4XPage_appear (earlier kept it this in Page_created but after looking for solution on forum, found a thread mentioning to use appear and disappear. Page 2 populates the customlistview basis map passed.
Problem :
When I first time load Page 1, select topic, populate questions map and load Page 2, it works fine.
But when I close Page 2 and come back to Page 1, then select another topic, refresh the map and show Page 2, I get below error on while adding item to customlistview. I tried close_page but didn't work. Currently wrote to clear the custom list view and then reload but still getting the same error.
Screenshots :
0. First page load. Even before adding any item in customlist
1. After first successful load, details of customlistview. and before clearing all the items while closing the page.
2. Even after clearing all the items using CLV.Clear, this shows.
3. When on re-load from Page 1 to Page 2, when trying to add first item.
4. Libraries that I am using
5. B4J version : 10.00
I have tried :
Using solution given in the links :
1. Solution given by Erel in post : How can I reload a B4XPage?
2. Using appear / disappear / clearing CLV before close / clearing each item before closing.
Code Error BEFORE using CreateLayout solution by Erel:
Code Error: After using CreateLayout solution by Erel.
Nothing worked. Please suggest solution.
I am facing a problem while using B4XPages in B4J.
I have two B4XPages.
Page - 1 : List of topics. Where a topic is selected. After selection of topic and click of action button, a map is populated with questions list and passed to page 2 and page 2 is shown.
Page - 2 : In B4XPage_appear (earlier kept it this in Page_created but after looking for solution on forum, found a thread mentioning to use appear and disappear. Page 2 populates the customlistview basis map passed.
Problem :
When I first time load Page 1, select topic, populate questions map and load Page 2, it works fine.
But when I close Page 2 and come back to Page 1, then select another topic, refresh the map and show Page 2, I get below error on while adding item to customlistview. I tried close_page but didn't work. Currently wrote to clear the custom list view and then reload but still getting the same error.
Screenshots :
0. First page load. Even before adding any item in customlist
1. After first successful load, details of customlistview. and before clearing all the items while closing the page.
2. Even after clearing all the items using CLV.Clear, this shows.
3. When on re-load from Page 1 to Page 2, when trying to add first item.
4. Libraries that I am using
5. B4J version : 10.00
I have tried :
Using solution given in the links :
1. Solution given by Erel in post : How can I reload a B4XPage?
2. Using appear / disappear / clearing CLV before close / clearing each item before closing.
Code Error BEFORE using CreateLayout solution by Erel:
Nullpointer exception while adding first item after re-load:
Error occurred on line: 76 (B4XListQuestions)
java.lang.NullPointerException
at b4j.example.customlistview._add(customlistview.java:75)
Code Error: After using CreateLayout solution by Erel.
Error after CreateLayout:
Private Sub CreateLayout
Root.RemoveAllViews
Root.LoadLayout("loListQuestions")
End Sub
Compiler error after page re-load:
java.lang.RuntimeException: Unexpected command: 0
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:316)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:513)
at anywheresoftware.b4a.keywords.Common.access$0(Common.java:493)
at anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.run(Common.java:567)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:185)
at java.lang.Thread.run(Thread.java:748)
Nothing worked. Please suggest solution.
Attachments
Last edited: