<?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: python add-in combobox - no visible value if editable = False? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-add-in-combobox-no-visible-value-if/m-p/211145#M16312</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi MC5,&lt;/P&gt;&lt;P&gt;I think it is best to keep the &lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;self.editable = true&lt;/PRE&gt;&lt;P&gt;I have placed the part where my items list is populated within the onFocus function.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def onFocus:(self, focused):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.items = []
**** THE PART THE POPULATES THE LIST ****


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.items.append(**VALUE**)

&lt;/PRE&gt;&lt;P&gt;The onSelChange fuction:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def onSelChange(self, selection)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.refresh()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X = selection&lt;/PRE&gt;&lt;P&gt;This function is used to do something with the selection that is made, setting the selection parameter to a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe the reason why you are not getting anything in the box is because of the editable attribute being false.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may be better served to look into putting an item in the List just as a starter. "Please Pick From the Dropdown."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then when the &lt;STRONG&gt;onFocus&lt;/STRONG&gt; is triggered it would empty the list items, and populate with new items that you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 10:23:48 GMT</pubDate>
    <dc:creator>ToddUlery</dc:creator>
    <dc:date>2021-12-11T10:23:48Z</dc:date>
    <item>
      <title>python add-in combobox - no visible value if editable = False?</title>
      <link>https://community.esri.com/t5/python-questions/python-add-in-combobox-no-visible-value-if/m-p/211144#M16311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I have a combobox that is set .editable = False to force the user to pick from its list, when the user does so, the selected value is not displayed in the combobox's text area - it stays blank with no indication of what was selected. I've even gone so far in the onSelChange() to set .value and call .refresh(), no difference. Am I missing something?&amp;nbsp; Thanks, MC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 14:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-add-in-combobox-no-visible-value-if/m-p/211144#M16311</guid>
      <dc:creator>theMC5</dc:creator>
      <dc:date>2014-08-05T14:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: python add-in combobox - no visible value if editable = False?</title>
      <link>https://community.esri.com/t5/python-questions/python-add-in-combobox-no-visible-value-if/m-p/211145#M16312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi MC5,&lt;/P&gt;&lt;P&gt;I think it is best to keep the &lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;self.editable = true&lt;/PRE&gt;&lt;P&gt;I have placed the part where my items list is populated within the onFocus function.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def onFocus:(self, focused):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.items = []
**** THE PART THE POPULATES THE LIST ****


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.items.append(**VALUE**)

&lt;/PRE&gt;&lt;P&gt;The onSelChange fuction:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def onSelChange(self, selection)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.refresh()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X = selection&lt;/PRE&gt;&lt;P&gt;This function is used to do something with the selection that is made, setting the selection parameter to a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe the reason why you are not getting anything in the box is because of the editable attribute being false.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may be better served to look into putting an item in the List just as a starter. "Please Pick From the Dropdown."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then when the &lt;STRONG&gt;onFocus&lt;/STRONG&gt; is triggered it would empty the list items, and populate with new items that you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:23:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-add-in-combobox-no-visible-value-if/m-p/211145#M16312</guid>
      <dc:creator>ToddUlery</dc:creator>
      <dc:date>2021-12-11T10:23:48Z</dc:date>
    </item>
  </channel>
</rss>

