Note that there are some explanatory texts on larger screens.

plurals
  1. POWix populate listbox
    primarykey
    data
    text
    <p>I am trying to fill in a ListBox with CustomAction and it's not going well. I try to figure out the <code>session.Database.Tables</code> but have no idea how to start.</p> <p>I've created a listbox like this </p> <pre><code>&lt;Control Id="ListBox1" Type="ListBox" Sorted="no" Indirect="no" Property="LISTBOXVALUESONE" X="10" Y="50" Width="150" Height="180"&gt; &lt;ListBox Property="LISTBOXVALUESONE"&gt; &lt;ListItem Text="ARGHH!" Value="1"/&gt; &lt;/ListBox&gt; &lt;/Control&gt; </code></pre> <p>But I cant see the property in my verbrose log or anything about an table so I guess I have to create an table in customAction and populate it? I see my <code>ARGHH!</code> in the list so it should exsist but how do I access the values? And add new ones?</p> <p>Found more examples and stuff in C++ but i would like to make the CustomAction in C#</p> <p>EDIT</p> <pre><code>Database db = session.Database; string sqlInsertTemp = db.Tables["ListBox"].SqlInsertString + " TEMPORARY"; View view = db.OpenView(sqlInsertTemp ); view.Execute( new Record( new object[] { "LISTBOXVALUESONE", 2, "2", "One" } )); view.Close(); </code></pre> <p>Thanks to Christopher I got it to work with adding an value.</p> <p><code>db.Tables["ListBox"]</code> should remain the same and name the type not the id as i taught And on this line <code>view.Execute( new Record( new object[] { "LISTBOXVALUESONE", 2, "2", "One" } ));</code> you put your Listbox Property and then the placement of the value "one" we insert</p> <p>The two "2"s is what I figure the placement we want it on and I already have an test value on 1 my "ARGHH!" so I put the new on 2 and dont know the details but...</p> <p>I got an Table Update error and, one dublicate value error if i put 2,1 or 1,2 in the customaction!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload