ObservableObject Set method only fires if value is different - kendo-mvvm

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.

Related

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

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.

How to set rule in qradar if something does not occur in event payload for some time?

I would like to set rule, if qradar does not find the string in event payload for one week? How can I do it?
I am looking to list of conditions, but I did not find any suitable condition. I have this:
when the event(s) have not been detected by one or more of there log source types for this many seconds
However I think it is not very suitable for me, because I need to work with payload. Could someone help me how to solve this problem?
One approach to resolve this problem is to use reference sets. A concept for this is explained here. You need two rules and a reference set:
Reference Set
Create a reference set and configure the time to live to the duration when the absence should be detected.
Rule 1 (Tracker Rule)
Set up a rule that triggers on the pattern whose absence you want to detect. In your case a string in the payload. Select "Add to a Reference Set" as rule response. Use the reference set from above.
Rule 2 (Watcher Rule)
Create a second rule which triggers on Event Name (or QID) "Reference Data Expiry". Maybe you need a custom event property for the name of the reference set and/or the expired element too. With this CEP you can test for the expiry of the item added from rule 1.

MSACCESS, how to edit a record after insert using the "after insert" trigger

MS Office 365 ProPlus, Access 2007 - 2016
I'm trying/failing to change the value of a field in a table after it is inserted using the "after insert" trigger. Something like this...
EditRecord
SetField
Name orig_id
Value = [mytable].[id]
End EditRecord
This doesn't seem to work.
USysApplicationLog gives...
SourceObject = mytable.AfterInsert
DataMacro InstanceID = {489D5697-5247-44A8-AE3C-3773A25F72E5}
Error Number = -20335
Category = Execution
Object Type = Macro
Description = EditRecord failed because the default alias represents a record which is read only.
The field is not read only. After the fact I can edit it just fine. I don't know what the "default alias" is nor what that even means.
If the trigger can't do this, can you think of another way to accomplish the same thing ?
You don't want to use the AfterInsert, since then the record is already saved, and tucked away nicely, and everything you need to change in that record is assumed to have been done. In fact, the default context will cause the record in question to be read only. You CAN get around this by pulling the record again, (looking up a record), but if you modify it again then all of the triggers for that record will fire again.
So I ONLY suggest you use this event to sum() or add/edit OTHER tables, but not the record that was just edited and saved.
If you need/want to update this current record, then move your "edit" or "modify" code to the "BeforeChange". This event not only lets you edit/modify right before the save (and thus preventing endless loops in which the update triggers fire again and again), but the CURRENT record is in full context, and you don't even need any "edit record" command, since you have the fresh un-saved record right in context. You thus can use SetField without the need for EditRecord.
So, the AfterInsert is really too late here, and if you could modify the record in that event, you will cause the AfteUpdate event to fire again if you do use a workaround.
Now, if you use BeforeChange, it will fire for both insert and edits (change). So, if your code really only needs to run when inserting, you can check this status by using
If [isinsert] = True then
Edit
Also, it looks like your code is attempting to save (capture) the previous value, and if it is, then you can use:
[old].[id]
Of course this does not make too much sense for "id", since that is usually an autonumber PK column, but for grabbing other values during an update in the BeforeChange event, you can certainly test + inspect the previous (old) values.

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.

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.