VL Web - Remove Focus from List

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

VL Web - Remove Focus from List

Post by jyoung » Wed Jun 08, 2016 7:53 am

I have a list of entries, in this case phone numbers.

When I delete an entry from the list using dlt_entry, focus is shifted to the first item in the list. This behavior is mentioned in the List-FocusItem documentation http://docs.lansa.com/14/EN/LANSA016/PR ... usItem.htm.

How then, do I remove the focus from the list after the delete? After the delete, nothing in the list should be focused / highlighted / selected etc.

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

Re: VL Web - Remove Focus from List

Post by Stewart Marshall » Wed Jun 08, 2016 8:55 am

Hi Joe

Short answer is that you can't. There's always a focus item if the list isn't empty.

However, you don't need to show it. You can change the ListItem DrawStyle in your theme, removing the FocusStyle from it, or you could make a new drawstyle.

For single selection lists, Selection and Focus are the same thing, so you'll still get a colour when an item's selected.
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au

jyoung
Posts: 651
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: VL Web - Remove Focus from List

Post by jyoung » Thu Jun 09, 2016 3:33 am

I am in VLF-ONE, so there so I don't think there is a theme, at least one is not applied on the UF_OEXEC page.

What I ended up doing for anyone else that runs into this is define a style.

Code: Select all

define_com class(#PRIM_VS.Style) name(#Style1) backgroundbrush(#Brush1)
define_com class(#PRIM_VS.SolidBrush) name(#Brush1) color(255:255:255)
Then after the item is deleted, set the FocusItem's FocusedStyle to the above style.

Code: Select all

dlt_entry from_list(#PhoneList)

if (#PhoneList.FocusItem *IsNot *NULL)
#PhoneList.FocusItem.FocusedStyle <= #Style1
endif

MarkD
Posts: 625
Joined: Wed Dec 02, 2015 9:56 am

Re: VL Web - Remove Focus from List

Post by MarkD » Thu Jun 09, 2016 9:08 am


jyoung
Posts: 651
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: VL Web - Remove Focus from List

Post by jyoung » Thu Jun 09, 2016 11:23 pm

I did not realize that.

When I went looking for the "Theme" I went to the UF_OEXEC page and did not see one so I incorrectly assumed it did not have one. My mistake.

Post Reply