Page 1 of 1

AlternBackColor for Web page

Posted: Thu May 09, 2019 3:35 pm
by Yukiko Ikeo
product: web page
version: v14sp2 EPC142040

Hi. Our customer wants to change the color of the line of the list alternately.
I could make it implemented with coding as below.

*****
Selectlist Named(#List1)
Case Of_Field(#STD_FLAG)
When Value_Is(= Y)
Set Com(#ListColumn1.CurrentItem) Mouseoverstyle(#Style2) Style(#Style2)
Set Com(#ListColumn2.CurrentItem) Mouseoverstyle(#Style2) Style(#Style2)
Set Com(#ListColumn3.CurrentItem) Mouseoverstyle(#Style2) Style(#Style2)
Set Com(#ListColumn4.CurrentItem) Mouseoverstyle(#Style2) Style(#Style2)
#STD_FLAG := N
When Value_Is(= N)
Set Com(#ListColumn1.CurrentItem) Mouseoverstyle(#Style3) Style(#Style3)
Set Com(#ListColumn2.CurrentItem) Mouseoverstyle(#Style3) Style(#Style3)
Set Com(#ListColumn3.CurrentItem) Mouseoverstyle(#Style3) Style(#Style3)
Set Com(#ListColumn4.CurrentItem) Mouseoverstyle(#Style3) Style(#Style3)
#STD_FLAG := Y
Endcase
Endselect
*****
PIC.PNG
PIC.PNG (4.49 KiB) Viewed 327 times
However, does anyone know more simple way? Is there suitable property?
AlternBackColor property of VisualStyle in previous version is preferable.

Thank you for your help.
Best regards, Yukiko Ikeo

Re: AlternBackColor for Web page

Posted: Thu May 09, 2019 11:30 pm
by jyoung
Checkout the AlternateItemThemeDrawStyle on the List

https://docs.lansa.com/14/en/lansa016/p ... wstyle.htm
Capture.PNG
Capture.PNG (6.82 KiB) Viewed 316 times

Code: Select all

begin_com role(*EXTENDS #PRIM_WEB) theme(#SYS_THEME<MaterialDesignBlue>)

define_com class(#PRIM_LIST) name(#List1) displayposition(1) left(168) parent(#COM_OWNER) tabposition(1) top(109) width(521) height(244) alternateitemthemedrawstyle('LightAccent')
define_com class(#PRIM_LIST.String) name(#List1Column1) columnunits(Proportion) columnwidth(1.35) displayposition(1) parent(#List1) sortonclick(True) source(#STD_TEXT)
define_com class(#PRIM_LIST.Number) name(#List1Column2) columnunits(Proportion) columnwidth(0.65) displayposition(2) parent(#List1) sortonclick(True) source(#STD_NUM)

evtroutine handling(#Com_owner.Initialize)

clr_list named(#List1)
begin_loop using(#std_num) to(200)
#Std_text := #std_num.AsString
add_entry to_list(#List1)
end_loop
endroutine


end_com
Hope this helps,
Joe

Re: AlternBackColor for Web page

Posted: Fri May 10, 2019 12:46 pm
by Yukiko Ikeo
Hi Joe,

Thank you for your help.
It worked well :D

Best regards, Yukiko Ikeo