Web list single cell style

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
avescovi
Posts: 25
Joined: Wed Mar 16, 2016 3:01 am
Location: Switzerland
Contact:

Web list single cell style

Post by avescovi » Thu Apr 14, 2016 6:43 pm

Hi,

I'am working on the data validation of a list in LANSA web.
When I detect an error on a cell, I would like to set its borders red. But at the moment I found only the way to set the border of the whole row and not for the single cell.

It is possible to control/set the style of a single cell?

Thanks

User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Web list single cell style

Post by Stewart Marshall » Thu Apr 14, 2016 7:58 pm

All visual lists in VL have a CurrentItem property. However, Prim_list takes this a step further providing a CurrentItem property on individual columns.

So, you might define your style as below

Code: Select all

Define_Com Class(#prim_vs.Style) Name(#Error) Bordercolor(Red) Borderbottom(1) Borderleft(1) Borderright(1) Bordertop(1)
and you can then assign it to a column currentitem as below

Code: Select all

#ColumnXYZ.CurrentItem.Style <= #Error
Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au

avescovi
Posts: 25
Joined: Wed Mar 16, 2016 3:01 am
Location: Switzerland
Contact:

Re: Web list single cell style

Post by avescovi » Thu Apr 14, 2016 10:03 pm

Hi,

Thank you for your quick reply.
It works only if I define the style as your. But my problem is that I don't want styles in the RP but only in a theme project (LANSA Theme).
As said in my first post, it's not possible to reach the style defined in the theme from a column.currentItem :

Code: Select all

* #lista.CurrentItem.ThemeDrawStyle := CampoInErrore
#ColumnUTGGRUT1.CurrentItem.Style <= #Style31
* #ColumnUTGGRUT1.CurrentItem.Style <= #CampoInErrore
The first is the way explained in the first post but it applies only for a whole row.
The second is your suggestion, it works only defining locally the style
The third one is what I want to do: assign to the cell the style or themed.rawstyle from a theme project.
(Note that #Style31 is a style and #CampoInErrore is a ThemeDrawStyle)

Thanks
Have a nice day

Andrea

User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Web list single cell style

Post by Stewart Marshall » Thu Apr 14, 2016 11:16 pm

Hi Andrea

You can directly access the the styles defined within a Theme as follows

#Column.CurrentItem.Style <= #ThemeName<StyleName>

I think this is what you're after


Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au

avescovi
Posts: 25
Joined: Wed Mar 16, 2016 3:01 am
Location: Switzerland
Contact:

Re: Web list single cell style

Post by avescovi » Fri Apr 15, 2016 12:11 am

Great, it works!

Thank you
Have a nice day

Post Reply