How to insert dynamic anchor/link in list/table

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
gillettd
Posts: 19
Joined: Tue May 24, 2016 2:13 pm

How to insert dynamic anchor/link in list/table

Post by gillettd »

Hi,

What's the easiest way to have a dynamic link in a table/list (v14) ..can't find anything in the doco

Please help

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

Re: How to insert dynamic anchor/link in list/table

Post by jyoung »

Unfortunately you can't add controls to a List, but you can add a reusable part.

Create a reusable part that implements IListCellDesign

From there you can add a label to act as your link and do whatever actions you need to.

Joe
caseywhite
Posts: 192
Joined: Thu May 26, 2016 1:17 am

Re: How to insert dynamic anchor/link in list/table

Post by caseywhite »

You can also do it with a reusable part. You can assign a themedrawstyle that makes your text look like a hyperlink. You can then either assign that themedrawstyle to the column if every cell will be clickable or just to a specific row if only some cells will be clickable. Then use the click even of the column to capture the fact that a row was clicked in the column. Something like below. The only drawback to this approach is that if you set the cursor to change when you mouseover, if won't change. If you want the cursor to change then you will need to use the approach jyoung suggested.

Code: Select all

Evtroutine Handling(#Com_owner.Initialize)
#deptment := 'XXXXXXXXXXXX'
#deptdesc := 'X DESC'
#std_title := 'XXXXXXXXXX'
Add_Entry To_List(#List1)

#deptment := 'YYYYYYYYYYY'
#deptdesc := 'y DESC'
#std_title := 'YYYYYYYYY'
Add_Entry To_List(#List1)
#ColumnDEPTMENT1.CurrentItem.ThemeDrawStyle := 'Hyperlink'

#deptment := 'ZZZZZZZZZZ'
#deptdesc := 'z DESC'
#std_title := 'ZZZZZZZZZ'
Add_Entry To_List(#List1)
#ColumnDEPTMENT1.CurrentItem.ThemeDrawStyle := 'Hyperlink'

Endroutine

Evtroutine Handling(#ColumnDEPTMENT1.Click)
#SYS_WEB.Alert Caption(#DEPTMENT)
Endroutine
Post Reply