Showing empty space instead "(null)" for columns with dropdown (valueOption)

Hi dear app builders,

is there are good way to show a empty cell instead “(null)” for columns with valueOption, if the cell is suppose to have a value (e.g. Default value for new line) which is not on the valueOption datasource?

image

Hi @do-hwan.kim,
you could use the custom component CustomCellHighlighting with the property replaceValuesWithEmpty:

It should be possible to add this entry replaceValuesWithEmpty: "(null)" to the table config to hide null cells.
I hope this could help you :slight_smile:

Hi @tobias.ziegler,

thank you for your reply.

Is there an example or a document, how the syntax would look like for setting up this property?

Thank you :slight_smile:

Unfortunately CustomCellHighlighting that does not work. The (null) is only replaced in the View mode of the table, not in the edit mode (tested with the CC table-cells-highlighting version 0.9.0).
So the problem remains, if the user adds a new row, she cannot use the dropdown of all valid options (valueOptions) unless she manually deleted the (null) string.

But what worked is to specify something in config.editing.defaults that is an allowed value according the valueOptions
Disadvantage: You need to hardcode the default value that is also present in the valueOptions, i.e., if you have "allowNewValues": false you need to know in your Apps JSON which default value would be possible. If the default value is something new, you again end up with (null)

What worked for my case:
config.editing.defaults sets an empty string for edit_table_column

And

      "valueOptions": [
        {
          "allowNewValues": false,
          "column": "edit_table_column",
          "valueColumn": "dropdown_values",
          "source": "dropdownValues_ds",
          "sourceOptions": {
            "sql": "(SELECT DISTINCT dropdown_values as dropdown_values FROM inputTable) UNION (SELECT '' as dropdown_values FROM inputTable)",
            "sort": [
              {
                "name": "dropdown_values",
                "order": "asc"
              }
            ]
          }
        }
      ]

Outcome:
If the user adds a new column, it is automatically filled with an empty string and the user can simply click on it to open the dropdown of possible values. In the Microservice after the save, I added an Assert to handle the case that no value is selected.