victorcamp
09-25-2010, 12:11 PM
I have searched and searched for a definitive answer to this question, and finally produced the desired result!
DESIRED RESULT:
Disable Next button on CustomSetup dialog if no features are chosen.
PROBLEM:
1. Next button events can certainly prevent the dialog from moving on
by defining event conditions that require at least one feature be chosen.
The Next button, however, remains enabled.
2. Next button conditions can set enable and disable based on the values
of each feature. However, the button does not process those conditions
until it's clicked. For example, both features are chosen when dialog
opens, so Next is enabled. If both features are then unchecked, Next
button remains enabled until it's actually clicked, then it reevaluates
the conditions and disables. If a feature is then chosen again, the
Next button remains disabled, with no way to force a reevaluation
of its conditions.
SOLUTION:
The SelectionTree can publish a SetProperty event that can be subscribed
to by the Next button, which enables and disables it as features are
chosen or eliminated, dynamically.
METHOD:
Add a New property named CUSTOMCHOICE, which will be treated as a
Boolean value of either 0 or 1.
Property Value
============ =====
CUSTOMCHOICE 0
Add two events to the SelectionTree itself (named: Tree), which will
set the value of CUSTOMCHOICE based on feature status. These SetProperty
events will be published by the SelectionTree, as documented in the
'SelectionTree Control' and 'SetProperty ControlEvent' Help file entries.
In this example, the project's InstallLevel is set at 3.
Event Argument Condition
============= ======= =========
[CUSTOMCHOICE] 1 (&Feature1=3) OR (&Feature2=3)
[CUSTOMCHOICE] 0 (NOT (&Feature1=3)) AND (NOT (&Feature2=3))
The Next button must have entries to both its conditions and subscriptions
to work as desired. As noted in PROBLEM 2, above, conditions alone produce
only static results. With the addition of a subscription, the effect
becomes dynamic. Though not listed in the dropdown list, 'SetProperty' is a
valid entry in the event column of the subscriptions list of the Next button.
Subscriptions:
Event Attribute
========= =========
SetProperty Enabled
Conditions:
Action Condition
===== =========
Disable (CUSTOMCHOICE=0)
Enable (CUSTOMCHOICE=1)
Events:
No change from standard.
With the above method, the Next button (or other control) reacts
dynamically to the choices made on the SelectionTree control.
It will flip on and off as you check and uncheck features.
I hope others can make use of this.
DESIRED RESULT:
Disable Next button on CustomSetup dialog if no features are chosen.
PROBLEM:
1. Next button events can certainly prevent the dialog from moving on
by defining event conditions that require at least one feature be chosen.
The Next button, however, remains enabled.
2. Next button conditions can set enable and disable based on the values
of each feature. However, the button does not process those conditions
until it's clicked. For example, both features are chosen when dialog
opens, so Next is enabled. If both features are then unchecked, Next
button remains enabled until it's actually clicked, then it reevaluates
the conditions and disables. If a feature is then chosen again, the
Next button remains disabled, with no way to force a reevaluation
of its conditions.
SOLUTION:
The SelectionTree can publish a SetProperty event that can be subscribed
to by the Next button, which enables and disables it as features are
chosen or eliminated, dynamically.
METHOD:
Add a New property named CUSTOMCHOICE, which will be treated as a
Boolean value of either 0 or 1.
Property Value
============ =====
CUSTOMCHOICE 0
Add two events to the SelectionTree itself (named: Tree), which will
set the value of CUSTOMCHOICE based on feature status. These SetProperty
events will be published by the SelectionTree, as documented in the
'SelectionTree Control' and 'SetProperty ControlEvent' Help file entries.
In this example, the project's InstallLevel is set at 3.
Event Argument Condition
============= ======= =========
[CUSTOMCHOICE] 1 (&Feature1=3) OR (&Feature2=3)
[CUSTOMCHOICE] 0 (NOT (&Feature1=3)) AND (NOT (&Feature2=3))
The Next button must have entries to both its conditions and subscriptions
to work as desired. As noted in PROBLEM 2, above, conditions alone produce
only static results. With the addition of a subscription, the effect
becomes dynamic. Though not listed in the dropdown list, 'SetProperty' is a
valid entry in the event column of the subscriptions list of the Next button.
Subscriptions:
Event Attribute
========= =========
SetProperty Enabled
Conditions:
Action Condition
===== =========
Disable (CUSTOMCHOICE=0)
Enable (CUSTOMCHOICE=1)
Events:
No change from standard.
With the above method, the Next button (or other control) reacts
dynamically to the choices made on the SelectionTree control.
It will flip on and off as you check and uncheck features.
I hope others can make use of this.