Page 1 of 1

HTML Container Height

Posted: Wed Aug 22, 2018 9:38 am
by ajr
Is there a way to dynamically adjust Html Container's height based on its content?

Re: HTML Container Height

Posted: Thu Aug 23, 2018 12:59 pm
by dannyoorburg
Hi,

Have a look at the following sample Web Page, it uses Sizing(ContentHeight) on the HTML container.

Goodluck,
Danny

Code: Select all

Begin_Com Role(*EXTENDS #PRIM_WEB) LayoutManager(#Layout1)

Define_Com Class(#PRIM_VS.Style) Name(#Style1) BorderBottom(1) BorderLeft(1) BorderRight(1) BorderTop(1)

Define_Com Class(#PRIM_TBLO) Name(#Layout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Layout1Row1) DisplayPosition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Layout1Column1) DisplayPosition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Item) Name(#Layout1Item1) Alignment(TopLeft) Column(#Layout1Column1) Manage(#Button1) Parent(#Layout1) Row(#Layout1Row1) Sizing(None) Flow(Down) MarginLeft(16) MarginTop(16)
Define_Com Class(#PRIM_TBLO.Item) Name(#Layout1Item2) Alignment(TopLeft) Column(#Layout1Column1) Manage(#Html1) Parent(#Layout1) Row(#Layout1Row1) Sizing(ContentHeight) Flow(Down) MarginLeft(16) MarginTop(16)

Define_Com Class(#PRIM_WEB.HtmlContainer) Name(#Html1) Description('Html Container') DisplayPosition(2) Height(200) Parent(#COM_OWNER) TabPosition(1) TabStop(False) Width(150) Top(57) Style(#Style1) Left(16)
Define_Com Class(#PRIM_PHBN) Name(#Button1) DisplayPosition(1) Left(16) Parent(#COM_OWNER) TabPosition(2) Top(16) Caption('Add some more HTML') Width(153)

Evtroutine Handling(#COM_OWNER.CreateInstance)
#Html1.Html := "I contain a line<br>"
#Html1.Html += "and another line <br>"
#Html1.Html += "and another line <br>"
Endroutine

Evtroutine Handling(#Button1.Click)
#Html1.Html += "and another line <br>"
Endroutine

End_Com

Re: HTML Container Height

Posted: Fri Aug 24, 2018 10:04 am
by ajr
Hi,

This works well. Thanks!