<?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: Access current value at selected array index in G Web Development Software</title>
    <link>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376877#M740</link>
    <description>&lt;P&gt;The context is helpful, thank you! For having an array of strings where the user needs to perform selection I think you can get a better experience using the &lt;A href="https://www.ni.com/docs/en-US/bundle/g-web-development/page/tree-control.html" target="_self"&gt;Tree control&lt;/A&gt;. You'll have to transform the data a bit to be an Array of clusters of strings but then the Tree control itself supports selection modes such as single / multiple as well as change events for when the selection changes as well as property nodes to see the current selected values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="treecontrolselection.png" style="width: 843px;"&gt;&lt;img src="https://ip1.i.lithium.com/d8dc60e05a8de96b425f5c8badcd7df30159b791/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33333338373269334642394134374237363939423636342f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="treecontrolselection.png" alt="treecontrolselection.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="treeselect.gif" style="width: 565px;"&gt;&lt;img src="https://ip1.i.lithium.com/c648b3382518ce823fe249ab1042cf0a0668b474/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33333338373369434236344244434537383744364636452f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="treeselect.gif" alt="treeselect.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jun 2024 21:35:39 GMT</pubDate>
    <dc:creator>MilanR</dc:creator>
    <dc:date>2024-06-04T21:35:39Z</dc:date>
    <item>
      <title>Access current value at selected array index</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376838#M737</link>
      <description>&lt;P&gt;After a specific array index is selected, how does the code access the array value at the selected index?&amp;nbsp; I don't see an index property in the array type.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 18:23:00 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376838#M737</guid>
      <dc:creator>johnsmith2022</dc:creator>
      <dc:date>2024-06-04T18:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Access current value at selected array index</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376864#M738</link>
      <description>&lt;P&gt;Just to clarify, for an array control on the panel are you asking for the current value of the indexers, i.e. similar to the LabVIEW &lt;A href="https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/properties-and-methods/vi-server/generic/gobject/control/array/indexvalues.html" target="_self"&gt;Index Values property&lt;/A&gt;?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MilanR_0-1717532267604.png" style="width: 400px;"&gt;&lt;img src="https://ip1.i.lithium.com/81aa4dda79787e45a81e6223fbab49911da24bc3/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33333338363769384532344531324139334633363437332f696d6167652d73697a652f6d656469756d3f763d76322670783d343030" role="button" title="MilanR_0-1717532267604.png" alt="MilanR_0-1717532267604.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you describe a little more about the behavior you are trying to achieve? I suspect you could use the JavaScript Library Interface to retrieve the value but curious what the workflow is to know if just being able to read the value is what is needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 20:17:53 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376864#M738</guid>
      <dc:creator>MilanR</dc:creator>
      <dc:date>2024-06-04T20:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Access current value at selected array index</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376866#M739</link>
      <description>&lt;P&gt;Hi Milan,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, similar to the LabView Index Values property as long as it provides the current index value of the array.&amp;nbsp; I've an array of text strings which are populated by retrieving file names with a specific suffix using a web service.&amp;nbsp; The user of the G Web App then selects which of the file names is desired, and that is to be supplied to another web service.&amp;nbsp; So when the user scrolls through the populated string array, whatever index is the currently displayed file name is the file name that I need to supply to the second web service.&amp;nbsp; The current solution is to have a numeric control right next to the string array indicator, and select which string array index is desired using the numeric control after scrolling through the available file names in the string array.&amp;nbsp; That's not optimal from a user experience; in fact it's quite awkward.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your quick response, and I'll await your suggestion(s) on a better approach.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 20:33:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376866#M739</guid>
      <dc:creator>johnsmith2022</dc:creator>
      <dc:date>2024-06-04T20:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Access current value at selected array index</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376877#M740</link>
      <description>&lt;P&gt;The context is helpful, thank you! For having an array of strings where the user needs to perform selection I think you can get a better experience using the &lt;A href="https://www.ni.com/docs/en-US/bundle/g-web-development/page/tree-control.html" target="_self"&gt;Tree control&lt;/A&gt;. You'll have to transform the data a bit to be an Array of clusters of strings but then the Tree control itself supports selection modes such as single / multiple as well as change events for when the selection changes as well as property nodes to see the current selected values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="treecontrolselection.png" style="width: 843px;"&gt;&lt;img src="https://ip1.i.lithium.com/d8dc60e05a8de96b425f5c8badcd7df30159b791/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33333338373269334642394134374237363939423636342f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="treecontrolselection.png" alt="treecontrolselection.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="treeselect.gif" style="width: 565px;"&gt;&lt;img src="https://ip1.i.lithium.com/c648b3382518ce823fe249ab1042cf0a0668b474/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33333338373369434236344244434537383744364636452f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="treeselect.gif" alt="treeselect.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 21:35:39 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376877#M740</guid>
      <dc:creator>MilanR</dc:creator>
      <dc:date>2024-06-04T21:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Access current value at selected array index</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376878#M741</link>
      <description>&lt;P&gt;Thank you.&amp;nbsp; Can you point me to an example using the Tree Control?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 21:16:35 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376878#M741</guid>
      <dc:creator>johnsmith2022</dc:creator>
      <dc:date>2024-06-04T21:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Access current value at selected array index</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376882#M742</link>
      <description>&lt;P&gt;Updated my last post to show an example and you can also see the &lt;A href="https://www.ni.com/docs/en-US/bundle/g-web-development/page/tree-control.html" target="_self"&gt;Tree control docs&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 21:35:06 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376882#M742</guid>
      <dc:creator>MilanR</dc:creator>
      <dc:date>2024-06-04T21:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Access current value at selected array index</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376884#M743</link>
      <description>&lt;P&gt;Thank you very much!&amp;nbsp; I'll come back if I have further questions.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 21:43:42 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376884#M743</guid>
      <dc:creator>johnsmith2022</dc:creator>
      <dc:date>2024-06-04T21:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Access current value at selected array index</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376887#M744</link>
      <description>&lt;P&gt;Okay, I'm doing something wrong.&amp;nbsp; I can't initialize the string cluster like you did statically; it needs to be built dynamically after the web service returns a comma-separated list of file names.&amp;nbsp; This is what I have so far (the array logic is the current approach). I added a Tree containing a string indicator (this may be incorrect).&amp;nbsp; Where am I going wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snippet.png" style="width: 400px;"&gt;&lt;img src="https://ip1.i.lithium.com/7e8de2c90a26d2615665333d4d6b9520d3ca6620/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33333338373569423939303339303732453542413144352f696d6167652d73697a652f6d656469756d3f763d76322670783d343030" role="button" title="Snippet.png" alt="Snippet.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2024 22:18:10 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376887#M744</guid>
      <dc:creator>johnsmith2022</dc:creator>
      <dc:date>2024-06-04T22:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Access current value at selected array index</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376900#M745</link>
      <description>&lt;P&gt;By default the Tree uses the value written to a terminal to determine the wire type, i.e. how many strings to expect in the cluster.&lt;/P&gt;
&lt;P&gt;If you don't use the terminal to set the initial data then I think the default is a cluster with two strings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can specify how many strings to expect by&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;wiring an initial value to the terminal or&lt;/LI&gt;
&lt;LI&gt;by unchecking &lt;FONT face="courier new,courier"&gt;Columns auto adapt from terminal&lt;/FONT&gt; and manually specifying the number of expected columns (one column per string in the cluster).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MilanR_0-1717551482222.png" style="width: 400px;"&gt;&lt;img src="https://ip1.i.lithium.com/98a21a11e2f1d2d1277ee727bd92d8577c7a4951/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33333338373969414334323630384435443639314233362f696d6167652d73697a652f6d656469756d3f763d76322670783d343030" role="button" title="MilanR_0-1717551482222.png" alt="MilanR_0-1717551482222.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, looking at your snippet it seems like the selection will be for file names, if you expect &lt;FONT face="courier new,courier"&gt;"\"&lt;/FONT&gt; characters in the strings please note that backslash characters (&lt;FONT face="courier new,courier"&gt;"\"&lt;/FONT&gt;) in the first column / first string of the cluster are treated as paths and used to build a hierarchy. It's possible that:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The hierarchy feature is useful for representing your data&lt;/LI&gt;
&lt;LI&gt;The hierarchy behavior is undesirable, so instead maybe make a cluster of two strings where the first string represents data that does not include a path, like an index.&lt;/LI&gt;
&lt;LI&gt;The hierarchy behavior is undesirable, so you escape slashes in the strings to avoid showing the strings in a hierarchy as discussed in the &lt;A href="https://www.ni.com/docs/en-US/bundle/g-web-development/page/tree-control.html" target="_self"&gt;Tree docs&lt;/A&gt;.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 05 Jun 2024 01:48:09 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4376900#M745</guid>
      <dc:creator>MilanR</dc:creator>
      <dc:date>2024-06-05T01:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Access current value at selected array index</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4380623#M746</link>
      <description>&lt;P&gt;I've been unable to dynamically build the Tree Control with file name strings, so for now I'm going to leave it as a&amp;nbsp;&lt;SPAN&gt;numeric control right next to the string array indicator even though it's not a great solution.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 20:37:41 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4380623#M746</guid>
      <dc:creator>johnsmith2022</dc:creator>
      <dc:date>2024-06-24T20:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Access current value at selected array index</title>
      <link>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4381739#M750</link>
      <description>&lt;P&gt;Hi Milan,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Okay I was able to get this to work.&amp;nbsp; Deleting an entry from a tree is not straight forward.&amp;nbsp; I had to loop through the clusters checking for a string match for the current selected value (with the addition of a Delete button), then save the index and delete that value.&amp;nbsp; I think the array structure needs a current index property like LabView has.&amp;nbsp; Thanks for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 12:38:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/G-Web-Development-Software/Access-current-value-at-selected-array-index/m-p/4381739#M750</guid>
      <dc:creator>johnsmith2022</dc:creator>
      <dc:date>2024-07-01T12:38:47Z</dc:date>
    </item>
  </channel>
</rss>

