VLWeb List Horizontal Scrolling

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
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

VLWeb List Horizontal Scrolling

Post by jyoung »

When using a List in VL Web with one Column (STD_STRNG) that has "ColumnUnits" set to "Proportion" and "ColumnWidth" set to "1", should the list horizontally scroll when the value of STD_STRNG is longer than the list?

Code: Select all

begin_com role(*EXTENDS #PRIM_WEB)
define_com class(#PRIM_LIST) name(#List1) displayposition(1) left(64) parent(#COM_OWNER) tabposition(1) top(56)
define_com class(#PRIM_LIST.String) name(#ColumnSTD_STRNG1) columnwidth(1) displayposition(1) parent(#List1) source(#STD_STRNG) columnunits(Proportion)

evtroutine handling(#Com_owner.Initialize)

#STD_STRNG := "this is some really really really long text. Yep it is still going. Are we there yet? Nope, keep going and going and going ...."

add_entry to_list(#List1)
endroutine

end_com
Renders this
Capture.PNG
Capture.PNG (3.34 KiB) Viewed 6154 times
So the text is cut off and not scrolling.

Am I missing a property somewhere? Should the list scroll horizontally?

Thanks,
Joe
dannyoorburg
Posts: 177
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

Re: VLWeb List Horizontal Scrolling

Post by dannyoorburg »

Hi Joe,

Remember a list can have multiple columns, even though you've only got one here.

The horizontal scroll bar's job is to bring all columns into view, it has nothing to do with the content of each column, only width its width.

Your one column here is columnunits(Proportion), so it's always the width of the list, so there's never a scroll bar.

Depending on the behaviour you want, there are a couple of options. You can word-wrap your text, or you can make the column wide enough to fit its content, which is what I've done in the snippet below.

Code: Select all

Begin_Com Role(*EXTENDS #PRIM_WEB)
Define_Com Class(#PRIM_LIST) Name(#List1) DisplayPosition(1) Left(64) Parent(#COM_OWNER) TabPosition(1) Top(56)
Define_Com Class(#PRIM_LIST.String) Name(#ColumnSTD_STRNG1) ColumnWidth(1) DisplayPosition(1) Parent(#List1) Source(#STD_STRNG)

Evtroutine Handling(#Com_owner.Initialize)

#STD_STRNG := "this is some really really really long text. Yep it is still going. Are we there yet? Nope, keep going and going and going ...."

Add_Entry To_List(#List1)

#ColumnSTD_STRNG1.SizeToContents

Endroutine

End_Com
Hope this helps,

Danny
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: VLWeb List Horizontal Scrolling

Post by jyoung »

Ok, setting the ColumnUnits to Pixels and ColumnWidth to some value (100) and then using the SizeToContents method works.

Thanks,
Joe
Post Reply