Making list item focused 

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
MegumiSawada
Posts: 80
Joined: Tue Mar 22, 2016 1:45 pm
Location: Tokyo, Japan

Making list item focused 

Post by MegumiSawada »

Hi
Focused.png
Focused.png (6.7 KiB) Viewed 8755 times
When one of the list item is focused in web page, the item looks something like top image.
I would like to make all the list item looks focused, like bottom image.
Is it possible to do so by setting some property or using theme/styles?

I appreciate your kind advice.

Best Regards,
Megumi Sawada
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Making list item focused 

Post by jyoung »

You can create a custom DrawStyle in your theme named DrawStyle1 (or whatever).
drawstyle.png
drawstyle.png (100.94 KiB) Viewed 8746 times
You can make this drawstyle look like your focused style.

Then attach that drawstyle to all your list items.

Code: Select all

#STD_INT := 1
dountil cond(#STD_INT > 5)
#STD_STRNG := "Hello " + #STD_INT.AsString
add_entry to_list(#List1)
#List1.CurrentItem.ThemeDrawStyle := DrawStyle1
#STD_INT += 1
enduntil
drawstyle list item.png
drawstyle list item.png (4.07 KiB) Viewed 8746 times
The list items will not be "focused" but they will look like it.

Hope this helps,
Joe
MegumiSawada
Posts: 80
Joined: Tue Mar 22, 2016 1:45 pm
Location: Tokyo, Japan

Re: Making list item focused 

Post by MegumiSawada »

Hi Joe,

Thank you for your advice!
There might be some restrictions, but with custom DrawStyle ,it seems I can do similar things to what I wanted to.

Best Regards,
Megumi
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Making list item focused 

Post by atostaine »

Wouldn't you just mark every item as selected, and then the current draw style is used?

selectList #Grid
#grid.currentItem.selected := true
upd_Entry #grid
endSelect

Grid selection style has to be multiple.

I don't know for sure if upd_entry is required.

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

Re: Making list item focused 

Post by Stewart Marshall »

You could set the items to be selected (UPD_ENTRY is not required), but this would change the moment you click in the list. The clicked item would become the FocusItem and all others would become Selected(False).

Far better then to use a DrawStyle as Joe suggested
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
Post Reply