AlternBackColor for Web page

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
Yukiko Ikeo
Posts: 26
Joined: Fri Jun 09, 2017 11:58 pm

AlternBackColor for Web page

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

Re: AlternBackColor for Web page

Post 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 5677 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
Yukiko Ikeo
Posts: 26
Joined: Fri Jun 09, 2017 11:58 pm

Re: AlternBackColor for Web page

Post by Yukiko Ikeo »

Hi Joe,

Thank you for your help.
It worked well :D

Best regards, Yukiko Ikeo
Post Reply