All Apps and Add-ons

Using the Splunk Web Framework Toolkit, how do you update the window URL token value with JS?

gmercier
Explorer

Hello,

In my dashboard, I added many dropdownviews with JS and they are interacting with each other.

Now, I want to add the value selected in the Window's URL for the user to stay in this state when he will refresh the browser page.

So I tried :

mvc.Components.getInstance("url").set("my_key", "my_value");

which isn't working. I mean, in the mvc model, the URL token group has been edited, but it didn't display in the URL.

After some tries around, I have noticed that when one more dropdown is added manually and associated to a token, and when it changes (and so the URL), the token "my_key" is pushed in the URL! So I guess that the native dropdown does something on the "onChange" to push the key in the URL.

I've tried randomly many functions in the "url" component prototypes (encode, validate, fetch, ...) but none of them seem to work, and the documentation about this is more than light.

Can someone help me with this please ?

It would be amazing 🙂

Thanks !

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...