Bug? [SOLVED] B4J Panes Layout Unexpected Behavior

cklester

Well-Known Member
Licensed User
2021.12.03 - Added a fixed project. Turns out I was using the same name for multiple panes. That is a no-no.

To duplicate the issue, run the attached app. You can see that the two layouts overlay each other, even though they are loaded into two different panes.

If you comment out one of the LoadLayout() calls, the other layout loads fine!

This works fine:
B4X:
'pane_BuyForm.LoadLayout("lo_OrderFormBuy")
pane_SellForm.LoadLayout("lo_OrderFormSell")

And this works fine:
B4X:
pane_BuyForm.LoadLayout("lo_OrderFormBuy")
'pane_SellForm.LoadLayout("lo_OrderFormSell")

But this does not!
This works fine:
B4X:
pane_BuyForm.LoadLayout("lo_OrderFormBuy")
pane_SellForm.LoadLayout("lo_OrderFormSell")

I just discovered prior to posting this that if you switch their order, it works!
B4X:
pane_SellForm.LoadLayout("lo_OrderFormSell") 'do this one first...
pane_BuyForm.LoadLayout("lo_OrderFormBuy")

What's going on?! I smell a bug! 😁
 

Attachments

  • testing_layouts.zip
    11.1 KB · Views: 136
  • fixed.zip
    11.2 KB · Views: 133
Last edited:

LucaMs

Expert
Licensed User
Longtime User
You messed with the Panes names in the layouts.
In lo_____OrderFormBuy you have pane_SellForm. <---- If I typed its exact name, it would display as in my next post.

Also, use different names for the Panes in the MainPage and in the two layouts (and label3 too).
 
Last edited:

cklester

Well-Known Member
Licensed User
You messed with the Panes names in the layouts.
In lo_____OrderFormBuy you have pane_SellForm. <---- If I typed its exact name, it would display as in my next post.

Also, use different names for the Panes in the MainPage and in the two layouts (and label3 too).

Good hunting, detective!

Weird that it works fine if you switch the LoadLayout() calls around.
 

cklester

Well-Known Member
Licensed User
Thank you.

You can show that you appreciate my posts with LIKEs or, if you prefer, donate $ 100 for each one 😄

I gave you a "Thank You." Do you prefer "Likes?"

When I'm a billionaire, I will remember you... Well, you might have to jog my memory...
 
Top