Skip to main content


 

Symptoms


A list view column is showing the actual value of the record rather than the "Display" value. For example instead of showing "First Name Last Name", it's showing an Id number for the user. A dropdown was used to input the data.
 

Diagnoses


Created a small project to illustrate the issue
 

Resolution

This behavior is by design. The display values derived from the values mapped to the control live only within the confines of the control, so once outside of the confines of the control the data does not exist hence the behavior being experienced. The value is what will be inserted into the db once the save action is complete.




 

In 4.6.11, I was able to achieve related display value by editing the view in Designer, selecting the column in the List View ("field" in K2 parlance), then use the Change Control button to change the column's control type to Drop-Down List. Now just use the control properties to configure the Data Source to show the desired lookup and dipslay values.

 

A side note: the "Display Field" value in the Detail subsection of the control properties will now be "(None)", and that is correct. I guess it means "no field will give the value, the data source will instead" rather than "no displaying".

 

Another side note: values in the column which do not appear in the related display object's keyspace were gracefully handled: the column value for those rows were just blank. Of course "bogus" data should never be allowed into the table without proper validation and children always cleaned out when parents are deleted and so on. But note that there probably isn't a way of distinguishing between an actually empty column and an orphaned foreign key value.


Reply