Table cells not clearing

I created tables using the Bootstrap 4 table generator and I am having issues updating table fields when the data changes. for example, if I delete a record and on the form success action reload the table, the fields stay populated with the previous data.
Also, I created a search text field that provides a query parameter to the sever action and when the data updates, fields that are empty in the database do not remove the data that was in the table cell causing the records to appear to incarcerate.
For example one of the fields is “completed date”. If the table shows all records with some that have a completed date and some with a blank field and then I enter a search for a certain job. Whatever was in the cell for “completed date” stays, but all the other dates changes, but if I reload the page the records display correctly.
What am I doing wrong.

When you change the data in the database, you will need to refresh (reload) the data source. As an example, here I insert new data (Gallery). On succes, the Server Connect is (re-)loaded.

image

There is also an issue with columns containing NULL which do not sort correctly. Columns with a null content should be set to 0 or an empty string “” either at application or database level

See @psweb 'as great Productivity Tips and Tricks, it’s Tip number one!

Thanks for your quick reply. This does not work for me. I have a search textfield that is used to pass a search parameter back to the server action that queries three fields with the contains operator. every time the input of the textfield updates I reload the query.
for the most part the search works correctly. Where I am running into the issue is when the returned field is null.
For example one record has name, entered date, due date, completed date. If there is no value in the due date field the old text persists and does not clear to show an empty table cell. However if there was a due date entered the cell will correctly update. So the issues is null values being returned for that particular cell.
How would I deal with this situation?

I was able to fix this issue by NOT using Inner Text on the cell, which is the default behavior of the Bootstraps 4 table generator, but instead putting a paragraph in the cell and using the “show” behavior, and only show it the value is not null for the field. What is odd is that the Dreamweaver Bootstrap 3 table generator works without doing this step. Is this a bug?

Yes, that’s what I said above about nulls. If is explained clearly in the above post.
The method you have used is not the way to do it.

Either set a default in our database fields i.e. 0 or empty string i.e. “” rather than default to null
Alternatively use dynamic bindings and set a default

For example Instead of something like

<td dmx-text=MyField"></td>

use a dynamic binding with a default to change the nulls to an appropriate value

<td>{{myfield.default('')}}</td>

It’s not a bug, it in intentional as it improves performance

1 Like

Right, I somehow missed the null thing before. Thanks for your help.

I just figured out something that still allows me to use innertext using the ‘or’ (||) operator with the data formatter.
When I use the ‘||’ operator the field shows what follows it if the recored is empty. If you want it to just be blank and still show use || and use “” with the kind as variable no literal.