GridColumnSelect - Bind single source to multiple grid columns

Given two entities:


Person {

ID - Integer (primary key),

Name - Text

}


WorkProduct {

ID - Integer (primary key),

DesignerID - Person Identifier,

DoerID - Person Identifer,

InspectorID - Person Identifier

}


and two structures:


PersonREST {

ID - Person Identifier,

Name - Text

}


WorkProductREST {

ID - WorkProduct Identifer,

DesignerID - Person Identifer,

DoerID - Person Identifer,

InspectorID - Person Identifer

}


I have created a DataGrid that is populated by a WorkProductREST List.

Column 1 is a GridColumnText that correctly populates from the "ID" column.


How do I set up GridColumnSelect(s) for DesignerID, DoerID, and InspectorID, each bound to PersonREST List?  Any Person can play any role in a WorkProduct (i.e. there is no particular "Role" for a person).


In many other ComboBox and lookup controls, we can define the bindings for the list values ("list source"), the binding for the row attribute ("column value"), and the mapping between the two (control value -> row value).


It is not clear to me either in the documentation or in the sample application how any mapping of the control's list to the current row column value is accomplished.


Can I use some combination of "JSONField", "JSONFieldLabel" and "ComparatorJSONField", or do I have to create three PersonREST Lists, IDENTICAL except that the "ID" column is renamed ("ID" -> "DesignerID", "ID" -> "DoerID", "ID" -> "InspectorID")?

Hi Joe,


i found this interesting and had a little try.  Euhm, it looks to me like the mapping is done by name.  So, that's what you are suggesting at the end of your post.  

I tried with a single api method to get the possible values for all 3 dropdowns, but can't find a way to match things up.


See attached oml, on one demo screen I'm using a separate api method with unique id and name attributes, matching the same unique id and name attributes in the api that retrieves the grid data.  On the other screen I tried with a single api for all 3 dropdowns, and it does kind of show that there are rows in the dropdown, but I haven't found a way of actually making it show the names or get the selected id.


At first I tought that I only needed the id of each beatle in the api for the grid content, but the only way I'm able to make it work is to have both name and id.

So in your case it would be something like

grid api method  :  ID, DesignerId, DesignerName, DoerId, DoerName, InspectorId, InspectorName

designerdropdown api method :  DesignerId, DesignerName

doerdropdown api method  :  DoerId, DoerName

Inspector Api method :  InspectorId, InspectorName


And then for example your Designer dropdown would have

JSONField : "DesignerId"

JSONFieldLabel : "DesignerName"

JSONRestURL : url of the designerdropdown api method


Maybe there are smarter approaches then this, but it works, and if mapping indeed happens on name, then maybe this is the least complicated way to get around that.

Hope this helps,

Dorine

Hi Joe,

The best way is to use a combo boxes wherein Source record list would be a single PersonREST List (no need of multiple) and variable values for different roles will be the there identifiers from WorkProductREST.

With respect to how mapping will be accomplished, in each combo box following are the attribute which will play important role in mapping.

1. Variable attribute: This will be the WorkProductREST List's current row id of designer/doers/inspector

2. Source Record List: This will be the selection's record list, which in this case is PersonREST List.

3. Source Identifier Attribute: PersonREST ID used to map with WorkProductREST List each row's designer/doers/inspector ID

Combo Box looks for the Variable's value (ID) matching to Source Identifier Attribute in Source Record List, if matches then displays the Source Attribute which in this case is "Name" else will look for value in special list.


I have attached a sample developed putting the above use case, please check and let me know if it answers you doubt.

Link: https://upresh-tikam.outsystemscloud.com/GridColumnSelect/Entry.aspx

Regards,

Upresh Tikam 

Upresh Tikam wrote:

Hi Joe,

The best way is to use a combo boxes wherein Source record list would be a single PersonREST List (no need of multiple) and variable values for different roles will be the there identifiers from WorkProductREST.

With respect to how mapping will be accomplished, in each combo box following are the attribute which will play important role in mapping.

1. Variable attribute: This will be the WorkProductREST List's current row id of designer/doers/inspector

2. Source Record List: This will be the selection's record list, which in this case is PersonREST List.

3. Source Identifier Attribute: PersonREST ID used to map with WorkProductREST List each row's designer/doers/inspector ID

Combo Box looks for the Variable's value (ID) matching to Source Identifier Attribute in Source Record List, if matches then displays the Source Attribute which in this case is "Name" else will look for value in special list.


I have attached a sample developed putting the above use case, please check and let me know if it answers you doubt.

Link: https://upresh-tikam.outsystemscloud.com/GridColumnSelect/Entry.aspx

Regards,

Upresh Tikam 

Hi Upresh,

he's not talking about the OS combobox, but the DataGrid Select Column.


Dorine Boudry wrote:

Upresh Tikam wrote:

Hi Joe,

The best way is to use a combo boxes wherein Source record list would be a single PersonREST List (no need of multiple) and variable values for different roles will be the there identifiers from WorkProductREST.

With respect to how mapping will be accomplished, in each combo box following are the attribute which will play important role in mapping.

1. Variable attribute: This will be the WorkProductREST List's current row id of designer/doers/inspector

2. Source Record List: This will be the selection's record list, which in this case is PersonREST List.

3. Source Identifier Attribute: PersonREST ID used to map with WorkProductREST List each row's designer/doers/inspector ID

Combo Box looks for the Variable's value (ID) matching to Source Identifier Attribute in Source Record List, if matches then displays the Source Attribute which in this case is "Name" else will look for value in special list.


I have attached a sample developed putting the above use case, please check and let me know if it answers you doubt.

Link: https://upresh-tikam.outsystemscloud.com/GridColumnSelect/Entry.aspx

Regards,

Upresh Tikam 

Hi Upresh,

he's not talking about the OS combobox, but the DataGrid Select Column.

My bad Dorine, thanks for your feedback !