<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dynamically Setting default value in the textfield?? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Dynamically-Setting-default-value-in-the-textfield/m-p/178701#M17455</link>
    <description>&lt;P&gt;Probably the best way is to use the ValueSetter module's conditional abilities.  This stuff is deliberately limited but it comes in handy often. &lt;/P&gt;

&lt;P&gt;So right now you have a TextField on dashboard2.  Let's say its name param is "myTextField".  You want to pass the default value based on the upstream value of $myPulldown$.  Last but not least you have a Redirector on dashboard1.  and say that Redirector looks like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;module name="Redirector"&amp;gt;
  &amp;lt;param name="url"&amp;gt;dashboard2&amp;lt;/param&amp;gt;
  &amp;lt;param name="myTextField"&amp;gt;   ???   &amp;lt;/param&amp;gt;
  &amp;lt;param name="arg.earliest"&amp;gt;$search.timeRange.earliest$&amp;lt;/param&amp;gt;
  &amp;lt;param name="arg.latest"&amp;gt;$search.timeRange.latest$&amp;lt;/param&amp;gt;
&amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So you can sneak a ValueSetter into this picture like so.   Again the logic is very limited and here because you're setting multiple cases you have to give each one a priority flag.   But still... it does what you need with no custom code. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;module name="ValueSetter"&amp;gt;
  &amp;lt;param name="name"&amp;gt;dynamicTextFieldValue&amp;lt;/param&amp;gt;
  &amp;lt;param name="if.$myPulldown.rawValue$=someValue[priority=1]"&amp;gt;firstTextFieldValue&amp;lt;/param&amp;gt;
  &amp;lt;param name="if.$myPulldown.rawValue$=someOtherValue[priority=2]"&amp;gt;secondTextFieldValue&amp;lt;/param&amp;gt;
  &amp;lt;param name="default"&amp;gt;defaultTextFieldValue&amp;lt;/param&amp;gt;

  &amp;lt;module name="Redirector"&amp;gt;
    &amp;lt;param name="url"&amp;gt;dashboard2&amp;lt;/param&amp;gt;
    &amp;lt;param name="myTextField"&amp;gt;$dynamicTextFieldValue$&amp;lt;/param&amp;gt;
    &amp;lt;param name="arg.earliest"&amp;gt;$search.timeRange.earliest$&amp;lt;/param&amp;gt;
    &amp;lt;param name="arg.latest"&amp;gt;$search.timeRange.latest$&amp;lt;/param&amp;gt;
  &amp;lt;/module&amp;gt;
&amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2) A totally different way to do it,  is to use a different ValueSetter trick with the Pulldown itself, to get multiple values coming out of the Pulldown directly.   This has been covered in a number of other questions so I'll just link to a good one.  &lt;A href="http://answers.splunk.com/answers/91244/pulldown-module-statically-setting-two-values-per-pulldown-option"&gt;http://answers.splunk.com/answers/91244/pulldown-module-statically-setting-two-values-per-pulldown-option&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;3) Last but not least you could use some custom code.  I always see this as a last resort, but you can use a CustomBehavior module and implement the getModifiedContext method.  In that method look at the upstream value of the pulldown key, set whatever keys you need, then return the modified context instance.&lt;/P&gt;</description>
    <pubDate>Sat, 08 Mar 2014 20:35:47 GMT</pubDate>
    <dc:creator>sideview</dc:creator>
    <dc:date>2014-03-08T20:35:47Z</dc:date>
    <item>
      <title>Dynamically Setting default value in the textfield??</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Dynamically-Setting-default-value-in-the-textfield/m-p/178700#M17454</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I want to set the default value for a Textfield dynamically. like for example i select particular device in dashboard1, this device has some 8 parameters so when i select a particular device and click "view parameter details" button, i want it to send default values for those parameters to dashboard2. And these default values should get changed on different device selection.&lt;BR /&gt;
How can i do this? any idea?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Mar 2014 08:22:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Dynamically-Setting-default-value-in-the-textfield/m-p/178700#M17454</guid>
      <dc:creator>shri_27</dc:creator>
      <dc:date>2014-03-08T08:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Setting default value in the textfield??</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Dynamically-Setting-default-value-in-the-textfield/m-p/178701#M17455</link>
      <description>&lt;P&gt;Probably the best way is to use the ValueSetter module's conditional abilities.  This stuff is deliberately limited but it comes in handy often. &lt;/P&gt;

&lt;P&gt;So right now you have a TextField on dashboard2.  Let's say its name param is "myTextField".  You want to pass the default value based on the upstream value of $myPulldown$.  Last but not least you have a Redirector on dashboard1.  and say that Redirector looks like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;module name="Redirector"&amp;gt;
  &amp;lt;param name="url"&amp;gt;dashboard2&amp;lt;/param&amp;gt;
  &amp;lt;param name="myTextField"&amp;gt;   ???   &amp;lt;/param&amp;gt;
  &amp;lt;param name="arg.earliest"&amp;gt;$search.timeRange.earliest$&amp;lt;/param&amp;gt;
  &amp;lt;param name="arg.latest"&amp;gt;$search.timeRange.latest$&amp;lt;/param&amp;gt;
&amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So you can sneak a ValueSetter into this picture like so.   Again the logic is very limited and here because you're setting multiple cases you have to give each one a priority flag.   But still... it does what you need with no custom code. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;module name="ValueSetter"&amp;gt;
  &amp;lt;param name="name"&amp;gt;dynamicTextFieldValue&amp;lt;/param&amp;gt;
  &amp;lt;param name="if.$myPulldown.rawValue$=someValue[priority=1]"&amp;gt;firstTextFieldValue&amp;lt;/param&amp;gt;
  &amp;lt;param name="if.$myPulldown.rawValue$=someOtherValue[priority=2]"&amp;gt;secondTextFieldValue&amp;lt;/param&amp;gt;
  &amp;lt;param name="default"&amp;gt;defaultTextFieldValue&amp;lt;/param&amp;gt;

  &amp;lt;module name="Redirector"&amp;gt;
    &amp;lt;param name="url"&amp;gt;dashboard2&amp;lt;/param&amp;gt;
    &amp;lt;param name="myTextField"&amp;gt;$dynamicTextFieldValue$&amp;lt;/param&amp;gt;
    &amp;lt;param name="arg.earliest"&amp;gt;$search.timeRange.earliest$&amp;lt;/param&amp;gt;
    &amp;lt;param name="arg.latest"&amp;gt;$search.timeRange.latest$&amp;lt;/param&amp;gt;
  &amp;lt;/module&amp;gt;
&amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2) A totally different way to do it,  is to use a different ValueSetter trick with the Pulldown itself, to get multiple values coming out of the Pulldown directly.   This has been covered in a number of other questions so I'll just link to a good one.  &lt;A href="http://answers.splunk.com/answers/91244/pulldown-module-statically-setting-two-values-per-pulldown-option"&gt;http://answers.splunk.com/answers/91244/pulldown-module-statically-setting-two-values-per-pulldown-option&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;3) Last but not least you could use some custom code.  I always see this as a last resort, but you can use a CustomBehavior module and implement the getModifiedContext method.  In that method look at the upstream value of the pulldown key, set whatever keys you need, then return the modified context instance.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Mar 2014 20:35:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Dynamically-Setting-default-value-in-the-textfield/m-p/178701#M17455</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2014-03-08T20:35:47Z</dc:date>
    </item>
  </channel>
</rss>

