LabelPosition

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
soa
Posts: 287
Joined: Mon Dec 07, 2015 3:15 pm

LabelPosition

Post by soa » Fri Nov 25, 2016 1:18 pm

I'm building a responsive app and I'd like to move a field's label from the left to the top but this doesn't reflow as I expect - the label just vanishes (I assume hidden by the field above) and the edit portion stays where it is. Is there a way to achieve this effect.

davidbalansa
Posts: 47
Joined: Mon Feb 01, 2016 10:08 am
Location: Australia

Re: LabelPosition

Post by davidbalansa » Fri Nov 25, 2016 2:37 pm

Did you increase the height of the field and set the MarginTop property to provide space for the caption to show?

If It is being hidden by the field above you really should be using a Layout Manager like the Table Layout to control the positioning of your fields.

David

soa
Posts: 287
Joined: Mon Dec 07, 2015 3:15 pm

Re: LabelPosition

Post by soa » Fri Nov 25, 2016 3:31 pm

I'm using a layout manager with all the items aligned top left, flow down. In the IDE when I change the position of the label from left to top the height is automatically calculated and the whole field shifts to the left. In the web this doesn't happen. Even if I, in code, changed the height of the control it still leaves a space to the left where the label used to be.

User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: LabelPosition

Post by Stewart Marshall » Fri Nov 25, 2016 4:30 pm

When you change the position of the label in the IDE, we change other properties so that the field lays out correctly. This is a design time courtesy that we can offer because you're in the middle of a designer.

The runtime however, be it web or desktop, has no such luxury. It can only do what you tell it to do.

The good news is that it's a very simple process to achieve what you want.

Have a look at the tip I've just posted.

http://vlforum.lansa.com.au/viewtopic.php?f=4&t=1143

Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au

Post Reply