Displaying Custom Table with Drop Down List rows problem

George Tselios asked on June 7, 2020 16:04

Hi,

In a Custom Table I have a field of Integer Data Type and Drop Down List form control. The form control's data source is a list of options like:

1;Option 1
2;Option 2
3;Option 3

While I create or update records in the table, I am able to select a textual value (e.g. 'Option 1', 'Option 2', 'Option 3') from the drop down list which corresponds to the specific integer that will be stored in the table.

In the list view of the table records, instead of displaying the above mentioned textual information of the Drop Down list, I get the Integer number (e.g. 1, 2, 3).

How can I display the textual information of the drop down list instead of the actual number in the records list view?

Thanks in advance,
George

Recent Answers


Brenden Kehren answered on June 7, 2020 16:44

You'll have to do a lookup if that interger value against the custom table to get that display name. If you're on a page type, you can use a custom table data source and a basic repeater.

Or you can use a macro like so:

GlobalObjects.CustomTables["customtable.codename"].Items.FirstItem["ColumnName"]

0 votesVote for this answer Mark as a Correct answer

George Tselios answered on June 7, 2020 16:51

Dear Brender,

Thanks for your prompt answer.

The data of this custom table are consumed by in-memory operations and are never displayed to the end user of the portal. (Kind of an editable enumeration).

Actually what I need to do is to preserve a consistent user experience for back-end users/authors of the Admin platform. Is there any way to accomplish this?

Thanks in advance,
George

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on June 7, 2020 16:57

That's a different request base on your original question. I suggest using the concepts I mentioned and look into another way to get your data stored in memory/session.

0 votesVote for this answer Mark as a Correct answer

George Tselios answered on June 7, 2020 17:02

Dear Brenden,

Perhaps my original question was a bit vague regarding the display target of the custom table rows.

In any case is there a way to achieve what I describe in my second question?

Session state is out of the question since the data have to be persisted in the database and be editable.

Thanks in advance,
George

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on June 8, 2020 07:57

Not sure what is the background but, do you need the values to be integer? If not, use the value;name pair like:

blue;blue  
red;red  
green;green

So, in your case:

option 1;option 1  
option 2;option 2  
option 3;option 3
0 votesVote for this answer Mark as a Correct answer

George Tselios answered on June 8, 2020 09:46

Dear Juraj,

Thank you for your suggestion, but unfortunately I have to use integer values.

Isn't there any way to display the textual value instead of the integer value in the list view of the Custom Table Data admin form?

Thanks in advance,
George

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on June 9, 2020 08:33

I am afraid not, it is taking the value actually stored in the database for given record. This would require a customization of the UI and the UniGrid used there and add the loop up logic to pair the value with appropriate name.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.