<core-localstorage> overwrites value get from url - polymer

I use <core-localstorage> to store some values, but sometimes I want to set these values to url parameters in lifecycle callback ready(or other), in this case I don't want the previous values saved by <core-localstorage> overwrite new values. Now I can only set values after event core-localstorage-load fired, are there any other methods? Thanks!

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.

Wanting to display a method return using HTML 5 data attribute

So I have a dynamic table in angular where im passing data in, then creating the table. I want to add some CSS in order to check the values then add some styling onto it. So if the value is a minus number, then display the data in red
I have used attribute data to check the actual data, which works fine until i call to typescript method to generate the data instead of hardcoding the data in, and this is where is goes wrong. So I want to call this method to get the data instead, and it just displays the method name instead of the method return
You can use the attribute binding of data instead of the interpolation if the data returned by the method is not a string - more details here
[attr.data]="getData(header, body)"

Unable to pass jmeter post call's dynamic response to get call

am new to JMeter. I hit the multiple "post" calls with the different data sets. Every post call results in unique id as the response. I want to again pass the each unique id to "get" call with 5 mins interval. I have extracted the unique id by regex extractor. The problem is, I can only pass the last unique id to "get" call instead of every unique id. Is there a way we can create dynamic regex-key and downstream the value for further use?enter image description here
There are certainly multiple ways in which you could solve for this. To name a couple:
Capture each of the different POST response ID's as unique variables, which could then be used in future GET calls, each requesting with one of the unique ID's.
Example: ID1, ID2, ID3, etc...
Create separate thread groups for each of these POST/GET scenarios. The JMeter variable will only be local to the thread group, so they will be isolated from one another. This would also provide the possibility of running them concurrently if so desired.
Using a variable (a count of sorts) to increment on each POST, and appending it to a common variable name.
Example: ID${count} . You would have to add a Beanshell Preprocessor to increment the count variable within each HTTP Request Sampler.
int count = Integer.parseInt(vars.get("count"));
count = count + 1;
vars.put("count", count.toString());
You could then iterate until reaching the value of count in a While Controller when making the GET requests, or you could decrement count. Both would serve the same function, provided the condition in the While statement is satisfied. Additionally you could use a Loop controller with count as the # of iterations, and simply have another count that increments for the life of the loop.
Probably the easiest way will be using an incrementing postfix like:
Add __counter() function as a postfix for your "Reference Name" like
Each time the Regular Expression Extractor will be called, a new batchid_N variable will be created where N is an incrementing number produced by the __counter() function
You will be able to access these variables values as ${batchid_1}, ${batchid_2}, etc. where required. There is also a possibility to use another JMeter Function or Variable as the postfix value via __V() function like:
${__V(batchid_${yourVar})} - combine "batchid_" prefix with ${yourVar} variable
${__V(batchid_${__counter(,)})} - combine "batchid_" prefix with __counter() function
See How to Use JMeter Functions article series for more information on above and others JMeter functions.

Kendo ComboBox value inconsistent with object sent to Update

I have an EditorTemplate with a ComboBox which is bound (via matching Name) to a property in my Model. The ComboBox is populated with some custom data objects via
.Name("MyType"
.DataTextField("Name")
.DataValueField("DBValue")
.DataSource( source =>
{
source.Read( read => { read.Action( "GetTypes", "MyController" ); } );
} )
I put a breakpoint at the click of the Submit button, and checked $('#MyType').val( ). It had a legitimate value ('ABC'). The value in the Model at this time was null. I put another breakpoint in the Controller at the Update action. At this point, the value in the Model was the string, '[object Object]'. This only seems to happen when the original value in the Model is null, but it is consistent when that is the case. Whenever the value in the Model is not null, even if it is '[object Object]', the next time I update it with the ComboBox, it stores the correct value.
What can I do to make sure the value from the ComboBox gets passed to the Update?
Apparently, as of this date, Kendo has a problem with ComboBoxes whose data-bound property is null, and their suggested work-around is to make sure the data-bound property is, in fact, not null. They are aware of this and are looking to provide for it in a later release.

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.