PopulateListBox fails on second time called - Advanced Installer Community
vikinglief
Posts: 4
Joined: Tue Sep 20, 2016 6:33 pm

PopulateListBox fails on second time called

As part of my install process, I need to ask the user for a list of items. The user should be able to add items one at a time, and see them in a list as they add them.

To that end, I have made a simple dialog that has an edit box, a push button, and a list box. My push button has 3 published events:
1.) Set Property- Property: AI_LISTBOX_DATA, Argument: MY_LISTBOX_1|[MY_EDITBOX_1]
2.) Execute Custom Action - Argument: PopulateListBox
3.) Refresh Current Dialog

When I test the installer, putting text in the edit box and clicking the push button correctly populates the list box with the text from the edit box. However, if I then change the text in the edit box to something else and click the push button again, the list box appears to not change.

Any ideas as to what I may be missing to get this to work as I intend it?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: PopulateListBox fails on second time called

Hello and welcome to our forums,

I've tested and replicated the behavior. This seems to be an Advanced Installer issue. A fix will be available in a future version of Advanced Installer, thank you for bringing it to our attention. We will notify you when the fix will be out.

Until then, as a workaround you can create and use your own custom action which will dynamically insert the items into your list box. Please take a look on our "Working with Windows Installer ComboBox and ListBox controls" article for a working example project.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
vikinglief
Posts: 4
Joined: Tue Sep 20, 2016 6:33 pm

Re: PopulateListBox fails on second time called

Hello Daniel! Thank you for your reply. It is some comfort to know that it was a bug rather than my missing some intended behavior.

For those curious, I managed to come up with a work-around, based on the Dual-List sample program mentioned in the linked article. Long & short, I had to create a property to track the current offset, and add a custom inline script to increment the offset. So my SetProperty became something like this: MY_LISTBOX_1#LISTBOX_OFFSET#1|[MY_EDITBOX_1].
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: PopulateListBox fails on second time called

You're welcome.

I'm glad you worked around this.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: PopulateListBox fails on second time called

Hello,

This issue was fixed starting with version 13.5. The scenario you reported in the first post on this thread should work now.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”