Page 1 of 1

Word wrapping in cell in list

Posted: Thu Apr 06, 2017 6:10 pm
by soa
I have a List with a single column. I have set the list rowsizing to Individual and in the column I've set the column units to proportional and wordwrap to true.

When I first did this I was delighted to see all my text beautifully wrapped with each line an appropriate height. However, when I tried to layout the list in page eg size = fit to height the wrapping stopped working - all lines are the same height and the text truncated.

Is there something else I should be doing?

(I've now removed the layout sizing and after trying various hard coded width/height settings I can no longer get wrapping back - there must be some lingering property somewhere!)

Re: Word wrapping in cell in list

Posted: Fri Apr 07, 2017 9:03 am
by Stewart Marshall
For word wrap to work in a list row, you need the List to have a RowHeight of zero and RowSizing to be individual. After that, set the column to be WordWrap true.

Code: Select all

Begin_Com Role(*EXTENDS #PRIM_WEB) Height(456) Width(528) LayoutManager(#Layout1) Theme(#SYS_THEME<2015Purple>)
Define_Com Class(#PRIM_TBLO) Name(#Layout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column1) DisplayPosition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row1) DisplayPosition(1) Parent(#Layout1) Height(82) Units(Pixels)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row2) DisplayPosition(2) Parent(#Layout1) Height(1.75)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem1) Column(#Column1) Manage(#Label1) Parent(#Layout1) Row(#Row1)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem2) Column(#Column1) Manage(#List1) Parent(#Layout1) Row(#Row2)

Define_Com Class(#PRIM_LABL) Name(#Label1) Caption('Word Warp in List Items') DisplayPosition(1) Ellipses(Word) Height(82) Left(0) Parent(#COM_OWNER) TabPosition(1) TabStop(False) Top(0) VerticalAlignment(Center) Width(528) ThemeDrawStyle('Title+DarkTitle') Alignment(Center)
Define_Com Class(#PRIM_LIST) Name(#List1) DisplayPosition(2) Left(0) Parent(#COM_OWNER) TabPosition(2) Top(82) Height(374) Width(528) ColumnLines(False) RowLines(False) RowSizing(Individual)
Define_Com Class(#PRIM_LIST.Number) Name(#ColumnXDEMONUMB1) ColumnWidth(88) DisplayPosition(1) Increment(1) Parent(#List1) Source(#xDemoNumber) Wrap(False) ColumnCaption('Item') ColumnCaptionType(Caption)
Define_Com Class(#PRIM_LIST.String) Name(#ColumnXDEMOCAPT1) ColumnWidth(1720) DisplayPosition(2) Parent(#List1) Source(#xDemoUnicode4K) ColumnUnits(Proportion) WordWrap(True)

Evtroutine Handling(#Com_owner.CreateInstance)

Begin_Loop Using(#xDemoNumber) To(50)

If (#xDemoNumber.Mod( 2 ) = 0)

#xDemoUnicode4K := "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
Else

#xDemoUnicode4K := "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."
Endif

Add_Entry To_List(#List1)

End_Loop

Endroutine

End_Com
Regards

Re: Word wrapping in cell in list

Posted: Fri Apr 07, 2017 11:28 am
by soa
My layout is a little more complex than yours as I have a RP with a layout hosting a panel with a layout and my list occupying col2/row2 with a sizing of fitboth.

What I've found after a lot experimentation is that when the page is first rendered the wrapping sizing appears not to have worked but if I drag the window up to force a vertical scroll bar to appear the list is redrawn correctly with wrapping and will then stay correct.

If I leave and renter the panel its back to its unwrapped/truncated state until I drag it around. It's a bit erratic. Is there a way to pro-grammatically force a redraw after I've loaded the list to make this work consistently.

Re: Word wrapping in cell in list

Posted: Fri Apr 07, 2017 12:05 pm
by soa
Attached are some screen shots that show the behavior.

Re: Word wrapping in cell in list

Posted: Fri Apr 07, 2017 1:21 pm
by Stewart Marshall
If you want to force a redraw, you could try setting the parent of the list to null and then back again.

More importantly, please report the behaviour to the support guys. It sounds as though you've found a bug

Regards

Re: Word wrapping in cell in list

Posted: Fri Apr 07, 2017 2:55 pm
by soa
Thanks, I'll keep on playing with this but the HTML solution (see my other question for today) provides a way of achieving the result I want without lists.