SubForm ComboBox variable not being set

Archived support forum for customers who once purchased a PrimalForms product license. This forum is locked.
This topic is 12 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
kghammonddc
Posts: 13
Last visit: Wed Aug 06, 2014 9:38 am

SubForm ComboBox variable not being set

Post by kghammonddc »

We have a mult form project setup.

In the subform, we have one combobox. After selecting an item, we click ok and we return to the main form. We then look at the variable:

$subform_combobox and it is empty.

We even tried manually setting the variable on SelectedIndexChanged but it is still empty. We do see the variable in the Primal Forms IDE, so the variable appears to exist...

Do we need to use the Load-ComboBox for that to work?

Thank You,
Kevin
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

SubForm ComboBox variable not being set

Post by davidc »

Thank
you for reporting the issue. This will be resolved in the next service release.
In the meantime you could also save the value to another variable: $script:comboxValue =
$comboBox1.TextDavid
David
SAPIEN Technologies, Inc.
User avatar
kghammonddc
Posts: 13
Last visit: Wed Aug 06, 2014 9:38 am

SubForm ComboBox variable not being set

Post by kghammonddc »

Thanks for the tip. We ended up creating globals to get around this issue.

Also we ran into a problem trying to set the index of a listbox or combobox when the listbox's source is a collection.

We ended up writing a function to do this. Since you have the Load-ListBox function you may want to do something similar for Selecting a listbox item.

Code: Select all

function SelectItem-ListBox { 
     Param ( 
          [System.Windows.Forms.ListBox]$listBox, 
          [string]$value 
     ) 
      
     for ($i=0;$i -lt $listBox.Items.Count;$i++) { 
          if ($listBox.Items[$i].Name -eq $value) { 
               $listBox.SetSelected($i,$true) 
          } 
     } 
      
}
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

SubForm ComboBox variable not being set

Post by davidc »

The last service build should have resolved the issue. David
David
SAPIEN Technologies, Inc.
This topic is 12 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.