This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Setting text from a command button action?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 04, 2007
10:11 AM
Setting text from a command button action?
Hi All,
I have two controls on a custom dialog. A button and a text control.
What I would like to do is click the button which brings up an external dialog (to get the user that will be assigned to my service component). The user would be chosen then when they exit the external dialog, they would be able to see the user chosen in the text box.
So far I have a "DoAction" that runs a VBScript custom action that gets the username and writes it to a property I called "SERVICE_USER_NAME", but I can't figure out how to have the text box "subscribe" to the setting of the property so that the username is shown.
Is this possible? If so, could you describe how this should be done? I don't understand the "subscribe" stuff.
Thanks for any help.
Tom
I have two controls on a custom dialog. A button and a text control.
What I would like to do is click the button which brings up an external dialog (to get the user that will be assigned to my service component). The user would be chosen then when they exit the external dialog, they would be able to see the user chosen in the text box.
So far I have a "DoAction" that runs a VBScript custom action that gets the username and writes it to a property I called "SERVICE_USER_NAME", but I can't figure out how to have the text box "subscribe" to the setting of the property so that the username is shown.
Is this possible? If so, could you describe how this should be done? I don't understand the "subscribe" stuff.
Thanks for any help.
Tom
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 05, 2007
10:12 AM
I'd really apprecriate some help here.
Thanks.
Thanks.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 05, 2007
10:20 AM
Oh, ok... I wasn't going to reply to this one, because I thought I might be missing something, but since you seem to be in need...
Ok, the thing I am missing is that I do not know what this "subscribe" thing you refer to is. But, I have encountered this issue in the past, and what I came up with is that there are two ways to handle this. The problem here is that the text control you have (which I assume is set to display a property) is loading the property at the time that you load the dialog, at which point the property isn't populated yet. As I said, I know of only two ways to accomplish what you're trying to do, and one of them has slipped my mind at the moment, so I'll go with the one I remember:
Create two dialogs, identical in every way, with one exception. Your button control (which will also be identical), will - as its last action - load the other dialog. And vice versa for the other button. In essence you're making a loop where the button alway loads the clone of the dialog it was called from. This way, you populate the text with some action on the button, and then when you hit "OK" or whatever you do, it loads the other dialog, except that now the property has a value, so the text displays.
Does that make sense?
Ok, the thing I am missing is that I do not know what this "subscribe" thing you refer to is. But, I have encountered this issue in the past, and what I came up with is that there are two ways to handle this. The problem here is that the text control you have (which I assume is set to display a property) is loading the property at the time that you load the dialog, at which point the property isn't populated yet. As I said, I know of only two ways to accomplish what you're trying to do, and one of them has slipped my mind at the moment, so I'll go with the one I remember:
Create two dialogs, identical in every way, with one exception. Your button control (which will also be identical), will - as its last action - load the other dialog. And vice versa for the other button. In essence you're making a loop where the button alway loads the clone of the dialog it was called from. This way, you populate the text with some action on the button, and then when you hit "OK" or whatever you do, it loads the other dialog, except that now the property has a value, so the text displays.
Does that make sense?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 05, 2007
01:54 PM
jedimaster_mark,
Thanks for the response.
The "subscribe" thing I was talking about is the "Subscriptions" tab found on the "Edit behavior" screen of a dialog. I "thought" that by subscribing to an event of another control, you could cause other UI elements to be updated.
As you've suggested, it looks like doing the "SpawnDialog" might be my best option. I've seen that once I click the "Next" button on my dialog, then click the "Back" button on the following screen that the text control will now display the text I was expecting. Apparently there isn't a straight-forward way to push text to a text control based on an event from another UI component. This is unfortunate.
I'll try using your suggestion. Again, thanks for the help.
Tom
Thanks for the response.
The "subscribe" thing I was talking about is the "Subscriptions" tab found on the "Edit behavior" screen of a dialog. I "thought" that by subscribing to an event of another control, you could cause other UI elements to be updated.
As you've suggested, it looks like doing the "SpawnDialog" might be my best option. I've seen that once I click the "Next" button on my dialog, then click the "Back" button on the following screen that the text control will now display the text I was expecting. Apparently there isn't a straight-forward way to push text to a text control based on an event from another UI component. This is unfortunate.
I'll try using your suggestion. Again, thanks for the help.
Tom
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 05, 2007
02:22 PM
Hmm... I suppose I should look into that tab. I was advised (and rightly so) to learn the core principals of Windows Installer and MSI architecture first, which I did. So, when I come across roadblocks like this, I go back to the fundamentals to devise a solution. This frees me from the limitations of the tool.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 06, 2007
10:21 AM
jedimaster_mark,
I've successfully implemented your suggestion. So, thank you for your help with this issue.
One thing I want to note here in case anyone else needs to do something like this and reads this thread. Make sure that you set your condition in the ControlEvent table to at least the value of 1 (meaning don't leave this field in the table blank) even if you don't have a condition per-say that you need to check on before executing this dialog switching technique.
I spent about an hour trying to figure out why my cloned dialog wasn't being executed after the button control. Once I put a condition of 1 in the ControlEvent table for the dialog action then it worked as expected.
Thanks again,
Tom
I've successfully implemented your suggestion. So, thank you for your help with this issue.
One thing I want to note here in case anyone else needs to do something like this and reads this thread. Make sure that you set your condition in the ControlEvent table to at least the value of 1 (meaning don't leave this field in the table blank) even if you don't have a condition per-say that you need to check on before executing this dialog switching technique.
I spent about an hour trying to figure out why my cloned dialog wasn't being executed after the button control. Once I put a condition of 1 in the ControlEvent table for the dialog action then it worked as expected.
Thanks again,
Tom
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 06, 2007
10:23 AM
You are very welcome. I need to turn to the forums for help from time to time, so it's only right that I give back to them.