A way to require dbc.Input to receive an updated value before triggering a callback while using debounce? - plotly-dash

I have a large, dynamic number of dbc.Inputs (~200) that trigger a callback.
Their id’s use pattern matching callbacks.
The value entered in the input updates a SQL db.
The problem I am facing:
I need to have debounce=True so that every keystroke doesn’t trigger the callback.
However, having debounce=True also makes it so that if the Input is clicked into, and clicked out of without any changes being made, it still triggers the callback.
Is there any way to make it so the callback only triggers if the current value has been changed? I was hoping this could be done within the args of the input itself but did not see any args that would achieve this.

Related

How to populate an append only long text data type field

I use a form to update/insert a database in Access 2016.
I found Access has an option to record version of a field value change if data type of this field is long text and append only property is set to yes. I decided to concat all the values of a single record and save to this long text (history) field.
Now I have added an invisible textbox control to that form. The value of this field i.e. "history" will be populated when an event occurs (on unload from form current record) and that invisible textbox control value is set running a function.
So now I need to know which event should I address to populate history field?
I tried several events but all say conflict!
This seems like a last changed date kind of problem. I have has success with using the form's before update event for this. E.g.:
Private Sub Form_BeforeUpdate(Cancel As Integer)
With Me
.LastChangedDate = Now()
End With
End Sub
If you are having trouble accessing the history from the control you could set a vba variable to it using the Current event of the form. Be careful, the Current Event fires for many reasons and the code has to defend itself from running except when you want.
I frequently test many conditions and switch settings so the Current event does not crash or worse. Trial and error needed.
For example, you could record the key of the record whose history you have saved for later and test to see if it has changed before saving it again. Also, I make sure that initialization of the OPEN and LOAD events are complete along with any other initialization necessary before I allow the Current event to do anything significant.
Good luck.

How does SSIS know which variable in an OnVariableValueChanged Event?

OK, I understand all the whys and wherefores of how to create variables in ssis and that the raise_change_event must be set for the event handler to work. And, I have a SQL task written to insert a record into the SysSSISLog when the event fires.
However, despite all my digging, I can't find where/how the event handle knows WHICH variable changed.
So, it appears to me if you have multiple variables, and anyone of them changes, then the OnVariableValueChange event would fire. This makes no sense and suggests to me that I am missing something incredibly simple.
Could someone please enlighten me? THanks...
When the value of a variable is changed, the OnVariableValueChangedEvent event will only fire if the RaiseChangedEvent property of that variable is set to true (which is false by default). One thing to keep in mind, if the variable contains an expression that relies on another variable, this event will only be raised if the RaiseChangedEvent property of the dependent variable is set to true, and the raised event will only correspond to the dependent variable.

ObservableObject Set method only fires if value is different

This looks like a bug, or at least poor documentation.
The kendo docs state:
set event
Fired when the set method is invoked.
The set event is raised before the field value is updated. Calling the get method from the event handler will return the old value. Calling e.preventDefault will prevent the update of the field and the change event will not be raised.
This dojo demonstrates that the set event is only fired when the set value is different to the existing value.
It would appear to me that, to be more correct, this method should be renamed "PreChange" and a new "Set" method created that actually fires when Set is invoked, as per the documentation.
Am I correct in stating this is a bug, or am I doing something wrong?
I got your point. Don't know if this could be a bug or not...
Just my 2 cents: I feel like it's a choice poor documented.
If you try to set an identical value, it seems the set event doesn't even trigger!
It's similar to the change event... if you write the same value, the event won't trigger.

JavaScript - Printing Out Event Handlers on Divs Outputted Using Arrays and a For Loop

I've been trying to figure this out for the last couple of days, but I just can't seem to get it right. The idea is that when someone fills out a form clicks a button named calc, it will gather the user input, store it in a variable, and output it into an array. Then, using a for loop, the messages stored in the array will populate below the form. I want each instance of the message, however, to have an event handle associated with it. Getting the event handler to work for all of the outputted messages just won't work. Thanks for the help! :)
http://jsbin.com/azozad/13/edit

getTag() method not properly working for google apps script

What i am doing in writing a script that lets the User interact with a data table. Every series that the user chooses creates a button, and then plots the series on a graph. if the user click the button it rooms the series. All there the data is stored in a hidden JSON string. the columns, or series that the user whats to see are stored in an array that i call index, it is also a hidden JSON string) Each button is connected to its own client handler, which has a
.forTargets(the index i was talking about).setTag(to the corresponding column in the data array)
and they are all connected to the same server handler. So when the button is clicked the client handler sets the tag for the index to the series that it is supposed to be removed. Now the server handler will run it get the index by ID and get the Tag. This is were it goes wrong. The tag is always null.
The first thing i tried was to see if my client handler was not working properly. So i set the tag of the index to some number, but the getTag method in the Server handler still returned null.
idk, but maybe Tags are not saved in the UI instance??
Below is the first bit of the Server handler.
function clickServer(e) {
e = e.parameter;
var app = UiApp.getActiveApplication();
var master = JSON.parse(e.dataTable, "reviver");
var index = JSON.parse(e.index, "reviver");
var hidden = app.getElementById("hiddenIndex");
var tag = hidden.getTag();
I think the issue you are meeting is more related to timing : handlers are called simultaneously, this is true for client an server handlers as well, that means that if the client handler changes a hidden tag value this change happens too late for the server handler function to 'see' it. What you should do is create a separate button to trigger the server handler that the user would use after all the other parameters where set.
This very same method is used in the known workaround used to get radioButtons value
Also, why do you use tags on the hidden widget ? you could use it with direct access by setValue() and e.parameter.hiddenName since they are already invisible by nature... ?
Note also that you can set a value in client handlers as long a these values are defined inside the Ui instance (the do Get function) either by constant variables or by another client Handler in the same function, as shown in the before mentioned example with radioButtons... but that's only a detail.
In this context if you need to get a widget value (inside the doGet function) you should of course use getValue() to get the widget value as no e.parameter is available at this time.
I hope I've been clear enough, re-reading this I'm not very sure but.... just ask if something is missing ;-)
The tags values are passed to handlers via parameters. In this post this fact is explained in details.