New line in List data

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
pbellardita
Posts: 6
Joined: Wed Mar 07, 2018 11:50 pm

New line in List data

Post by pbellardita »

Hi,
is there a way to force a new line inside a list cell?
for example, in this web page, I used the command (10).asUnicodeString in the caption of the columnHeader and in the column # Col1.

Code: Select all

Begin_Com Role(*EXTENDS #PRIM_WEB) Layoutmanager(#TableLayout1)
Define_Com Class(#PRIM_TBLO) Name(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column1) Displayposition(1) Parent(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row1) Displayposition(2) Parent(#TableLayout1) Height(1,81)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row2) Displayposition(1) Parent(#TableLayout1) Height(0,19)
Define_Com Class(#PRIM_TBLO.Item) Name(#List1Item1) Manage(#lista) Parent(#TableLayout1) Row(#Row1) Column(#Column1)
Define_Com Class(#PRIM_LIST) Name(#lista) Displayposition(1) Left(0) Parent(#COM_OWNER) Tabposition(1) Top(76) Height(724) Width(1200) Columnheaderheight(45)
Define_Com Class(#PRIM_LIST.String) Name(#Col1) Displayposition(1) Parent(#lista) Source(#STD_TEXT) Columncaptiontype(Caption)


Evtroutine Handling(#Com_owner.Initialize)
Define_Com Class(#prim_dc.UnicodeString) Name(#CarriageReturn)
#CarriageReturn := (10).AsUnicodeString /* Hex 0A */

#WRK_testo := 'Descr_1' + #CarriageReturn + 'Descr_2' + #CarriageReturn + 'Descr_3'
#Col1.ColumnCaption := #WRK_testo

Clr_List Named(#lista)
#STD_TEXT := 'row_1_1' + #CarriageReturn + 'row_1_2' + #CarriageReturn + 'row_1_3'
Add_Entry To_List(#lista)
#STD_TEXT := 'row_2_1' + #CarriageReturn + 'row_2_2' + #CarriageReturn + 'row_2_3'
Add_Entry To_List(#lista)
Endroutine
End_Com
the displayed result has new lines only in the Header.
Cattura.PNG
Cattura.PNG (2.77 KiB) Viewed 5061 times

How can I apply the same concept on every record in the list?

Thanks
JamesDuignan
Posts: 85
Joined: Thu Nov 26, 2015 1:43 pm

Re: New line in List data

Post by JamesDuignan »

Hi,

Yes this is possible, first you will have to set the Column word wrap property to true.

i.e.

Code: Select all

Define_Com Class(#PRIM_LIST.String) Name(#Col1) Displayposition(1) Parent(#lista) Source(#STD_TEXT) Columncaptiontype(Caption) WordWrap(True)
Regards,
James
pbellardita
Posts: 6
Joined: Wed Mar 07, 2018 11:50 pm

Re: New line in List data

Post by pbellardita »

it works!

Thanks James

Regards
Post Reply