cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
danieluc
Level 6

Can I call a CA from a Edit event?

Hi guys,

I come again with a question: using IS 2008 Premiere (BasicMSI project), I have to do the following: On a custom screen I have a edit box and a label; I have to change the label based on the text entered in the edit box, in real time. I thought I can do this by calling a "DoAction" in the dialog's Edit Events for that EditFiled. This action (VBS MSI Type Number: 38) must make some calculations and then reset the label's value.
Doing this results in an error when executing line Session.Property("EDIT_PROPERTY") :

Install Log:
[HTML]
Action 11:00:41: Test.
Action start 11:00:41: Test.
Action ended 11:00:41: Test. Return value 3.
Info 2896.Executing action Test failed.[/HTML]

After this I must refresh the label to see the changes on the GUI
Is this a wrong approach? Can this be done in a easier way? I would like to keep it simple ..

Any advice is appreciated,
Best Regards,
Daniell
Labels (1)
0 Kudos
(9) Replies
DLee65
Level 13

I do something similar in a custom dialog but not using the edit field and so I am not certain of the results.

Basically I have two labels already defined in the same x,y location. One label is visible, the other is not. I have conditions on the label based on a property value. If the property value is X then the label 1 is hidden and label 2 is visible. If the property value is Y then label 1 is visible and label 2 is hidden.

This works well with push button type controls such as Checkboxes, radio button controls, and normal push button controls.

For edit fields however, you will not be able to test conditions until the user leaves the edit field.

This approach works if you have a limited set of values that can be displayed. The other approach is through a custom action as you are pursuing. Just a word of caution, I would avoid use of vbscript custom actions as they can create chaos for debugging, for validation with antivirus software programs, etc.
0 Kudos
danieluc
Level 6

Hi DLee, thanks for your reply

I am looking for a way to trigger the execution of a custom action when the edit field is changed, make some calculations with the new value entered in the field .. , an then set a label with the result computed.
A simple thing that already gives my head headaches ...
😞
0 Kudos
RobertDickau
Flexera Alumni

Alas, that's evidently one of a handful of limitations of the MSI user interface, that it doesn't report events indicating that the contents of an edit field changed.

Please see KB article Q108570, "INFO: Limitations Of The Basic MSI User Interface", for some related information.
0 Kudos
danieluc
Level 6

Hi,

I've edited the dialogs event list for the EditField, with:

DoAction | TestAction | 1

and in that CA, I've simply showed a message box, and it worked: every time the field was edited, the message box appeared (now that I think of it it's just because the appearance of the message box triggers a loose of focus ..8-} ), but when doing this with the request of a Session.Property("SOME_PROPERTY"), it crashes.
So in conclusion, this cannot be done as I wish it must .. ?

Best Regards,
Daniell
0 Kudos
DLee65
Level 13

Here is a quick example of using control conditions to show and hide labels. This works when you are dealing with a limited set of values to show on a dialog.
0 Kudos
danieluc
Level 6

Meanwhile I managed to get a look on the ControlConditions, and with the hide/show is simple. The problem comes when wanting to refresh the label.
So this means that in ControlConditions, set something like:

Dialog | control | action | 1

and that action would be something like "Refresh" or "Update", to always update the value based on it's property (which has been changed meanwhile). I don't manage to see the actions available for the ControlConditions, to see which action will suit best ..
Any idea ?

Thanks,
Daniel
0 Kudos
danieluc
Level 6

Here is a test example. As you can see, the edit and the label have the same property name, the edit updates and the label no. 😞
I must do something wrong, but this is really annoying ..
Thanks
0 Kudos
DLee65
Level 13

Ahh, it was just a simple oversight. You needed to set the text value to [TEXT] as well as the label property attribute.

Here is the modified example. Note that when you leave the field using tab key then that is when the text is updated. It is not updated as you type characters into the field. Alas the Windows Installer engine does not permit monitoring character insertions.
0 Kudos
danieluc
Level 6

Now that I think of it, it makes sense. Uuf ..
Thank you very much Dan, :beer: 🙂
Best regards,
Daniel
0 Kudos