Date Range Error / Bug

So I have a table that, when a row is clicked, will fill user inputs. The specifics are here: Auto Filling Form From Table Data - #9 by ScottR.

I'm running into an issue with creating an event handler for a date range input. It is a row select change, control component event. When I set the component dropdown to the date range input I get the error below. I'm guessing the issue is related to how the date range is being stored. There is a start and end date in the DB that are filled using {{daterange.value.start}} and {{daterange.value.end}}. I imagine there is a JS solution but I can't even play around with it because this error pops up whenever I click on the event handler.

Is the date range stored in the DB of a certain type like Date or Timestamp?
And are you formatting the dateRange start using the correct format?

Ok so it looks like the issue came from duplicating the event handler. If you create a new one, there are separate inputs for start and end date and it works fine.

There does appear to be another issue though. When you clear the selection for the table, it doesn't reset the dropdowns, only the text fields.

When clearing the selection for the table, you will probably have to set an event handler to clear the drop downs as well

So what event would trigger that? I don't see any for clear selection.

And do you think there will be any performance issues with this many event handlers? If some fields need 2 there will be anywhere from 150-200 total event handlers.

That would be too many - if you can put all of those fields into a form, then you can just add an event like the following:
Screen Shot 2022-07-27 at 2.47.05 PM

It's too many fields to fit into a form, there are 128 fields spread out across 7 pages. I think I found a more elegant solution though. I'm creating 2 JavaScript queries . The first has something like insured_name.setValue(matters_table.selectedRow.data.insured_name) for each input field. The other has matters_table.selectRow(null) and something like insured_name.setValue(null) for each input. The table has a single row select change event handler to trigger the setValue query to run when the row is changed. Then there is a custom button on the table to trigger clearing the form instead of the built in clear form button.

1 Like