B4J Question B4J Layout ISSUE

jahswant

Well-Known Member
Licensed User
Longtime User
Hi.
I'm converting my B4A Project to B4J. I'm experiencing a surprising problem with my converted layouts. Everything seems to be on with the visual designer but when i compile it seems like my designer scrip is not applied to layout. Please refer to Video.

One of the layout files is attached.
 

Attachments

  • login.zip
    2.2 KB · Views: 92

jahswant

Well-Known Member
Licensed User
Longtime User
This is a test project. It clearly shows the issue.
 

Attachments

  • 237ZipFile.zip
    16.7 KB · Views: 99
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. There is indeed an issue with this layout. It was converted from a B4A layout, right? Copy all views and paste them in a new layout. I did it and it worked.

2. Not related to this issue, however you can delete almost all of the designer script and use anchors. Put all the views inside the panel. The text fields and button should be anchored to both sides. Use the designer script to horizontally center the main panel.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Responding to your PM, I copied all of the views (Ctrl-A, Ctrl-C then Ctrl-V) to a new layout as Erel suggested and copied the designer script across and it works as expected, types are copied too.

Although again as Erel suggested there are better ways to set up the layout. Using Anchors will be far easier.

The views don't move to the correct positions over pnlAction because they are children of Main and not pnlAction. if the views positions are to be constrained within a pane then it is better to make them children of the pane.
 
Last edited:
Upvote 0
Top