Multicolumn List Cell Interface - #prim_list.IListCellDesign

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
User avatar
belzswd
Posts: 8
Joined: Mon Jun 03, 2024 6:41 pm

Multicolumn List Cell Interface - #prim_list.IListCellDesign

Post by belzswd »

Background -
DEM component xDemoWebList consumes the following column defined as ..

Define_Com Class(#PRIM_LIST.Part) Name(#ColumnAddress) Displayposition(6) Parent(#List) Design(#xDemoWebListAddress) Columnwidth(157) Columncaption('Address')

Eg ..
#List.CurrentItem.RelatedReference <= #Employee

Question -
[1] I have a requirement to define & use >1 #PRIM_LIST.Part within a single List-Row - Actually my requirement would define multiple columns with the same cell Design(#x..) Steps for building this up seems straight forward, except when it comes to targetting a specific column using the #List.CurrentItem.RelatedReference <= #<data_component> statement .. As the RelatedReference seems to assume that only a single #PRIM_LIST.Part has been defined for the List (row). How can I code referencing that assigns my #<data_component> (that carries info related to which column the #dc belongs to), so that the related-reference targets the correct column upon the assignment?

[2] I have noted the method FindReference & wonder if I might use this method in some way to acheive my referencing goal. Reviewing the encyclopedia sample code for the FindReference method (version 15) some #Object is passed to the sample Find() routine, but it is not clear to me what this object should be.

Grateful for any help here.

Regards, Anthony. 🐏
BrendanB
Posts: 134
Joined: Tue Nov 24, 2015 10:29 am

Re: Multicolumn List Cell Interface - #prim_list.IListCellDesign

Post by BrendanB »

Anthony,

the #Employee that is set as the related reference is an #Employee object (which contains a number of 'properties' -- populated from a server module call).

you can put any object you like as the related reference. you would of course have to create your object. The related reference actually has little to do with the RP created for use in a list.

the line

#List.CurrentItem.RelatedReference <= #Employee

this assigns to the ROW this reference (meaning that all COLUMNS in the ROW have access to this object).

Brendan.
User avatar
belzswd
Posts: 8
Joined: Mon Jun 03, 2024 6:41 pm

Re: Multicolumn List Cell Interface - #prim_list.IListCellDesign

Post by belzswd »

Thanks for the response BB.

In terms of your explanation (appreciated), & my problem, we can say that I would like to associate different #Employee instances with corresponding COLUMN's in the targetted ROW.

Presently my design approach has a property (Map_X) in my data-object which is intended to clarify which column should be targetted during the *RelatedReference assignment. Also note that my ROW has 7 columns - All of these columns are (currently) based on the same RP; Also (currently) my (visual) list is confined to 7 rows (& for now this is not likely to grow); So if there's performance overhead for this approach, this should be offset by the small size of the list (which is a 7x7 matrix).

Can I assign >1 reference to each row?
I might infer from your clarification that, I may be able to assign all 7 instances of the DataObject to each row, then handle the discrete column association handling within the (redefined) OnItemGotReference of the visual RP - I can envisage this approach working, but I'm assumming that more than one reference can be assigned to each ROW - Perhaps this assumption is false - Comments welcome.

The email you sent (outside this thread) is also worth pursuing - I'm going to simplify the implementation I currently have (as there's some modelling complications superfluous to this focus) - I'll respond further with simplified components as attachment (to this thread, & the email) when I'm ready in these terms. If not tonight, then soon.

Thanks again, AB 🐏
BrendanB
Posts: 134
Joined: Tue Nov 24, 2015 10:29 am

Re: Multicolumn List Cell Interface - #prim_list.IListCellDesign

Post by BrendanB »

Anthony,

technically you can only assign 1 reference to each ROW.

of course, that reference could be an object which contains EITHER:

7 individual references (1 for each column)
or
a #prim_lcol<#myObject> (pre-load this 'list-collection' with the desired object references).

it sounds like you are attempting to do something like a multi-column list. This can be acheived with a #PRIM_MD.List or a #PRIM_TREE by utilising the 'ItemsPerRow' property... (each 'item' is a RP that can contain multiple things) OR even the #PRIM_TILE control.

#PRIM_TILE has a shipped example that has different employees in each tile... look for XDEMOWEBT (webpage) to see what it looks like.

Brendan.
User avatar
belzswd
Posts: 8
Joined: Mon Jun 03, 2024 6:41 pm

Re: Multicolumn List Cell Interface - #prim_list.IListCellDesign

Post by belzswd »

Appreciate your response/s thanks Brendan.

Sorry for the late reaction - I'm only attending this project part time, & yes my effort here is web-based.
I am familiar with Tiles & XDEMOWEBT - I've successfully used tiles elsewhere.
  • I chose not to adopt them (initially), as tile-collections are essentially a wrapping 1-dimensional list, whereas my requirement is certainly a fixed 2 dimensional representation.
    Obviously, I can fix the visual containing panel, so that (when wrapped) my 7x7 matrix (with fixed tile-cell size) presents as the 2 dimensional matrix I'm seeking.
Example - After pursuing the RelatedReference intrinsic, that attempts to use distinct RP's in each List/Column, my best (sample) result thus far yields -
Screenshot 2024-06-22 164415.jpg
Screenshot 2024-06-22 164415.jpg (20.44 KiB) Viewed 14274 times
Cell [1] relates to [x,y] = 4999,4999 here; Table is MapWindex
There is deliberate reason for the conditional cell-backgrounds, which is a key reason for the cell-based RP-demand ..


In this version, each cell is visited upon (up to) 3 times during the RelatedReference invocations (so 2 superfluous times each), & this could expand to 6 superfluous invocations (per cell!) for my 7x7 objective - That's (up to) 42x7 = 294 superfluous (client-side) invocations for the 7x7 table/matrix - Not pretty & far from ideal.

So I'm now embarking on a tiled implementation, but (when you have time!), I'm also curious about your suggestion regarding the #PRIM_MD_List - If you wished to provide some more clues about a #PRIM_MD_List implementation now you have my requirement in more detail & solution attempt, I'd be very happy.

Components yielding the actual (sample) result above are included herein (for posterity).

More to follow ..

Regards, AB 🐏
Attachments
QuickExport20240617153844.zip
(22.28 KiB) Downloaded 7320 times
Post Reply