I am having a problem with a setting the enabled state of a button on a Dialog. The button in question is defined as:
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
<Condition Action="disable">Validated = 0</Condition>
<Condition Action="enable"><![CDATA[Validated <> 0]]></Condition>
<Publish Event="EndDialog" Value="Return">1</Publish>
</Control>
The property Validated starts out at an initial value of 0, and as expected the next button starts out disabled.
<Property Id="Validated" Value="0"/>
The property itself is modified through a Custom Action on another button.
<Control Id="PerformValidation" Type="PushButton" X="225" Y="75" Width="50" Height="20" Text="Validate">
<Publish Event="DoAction" Value="ValidateDB">1</Publish>
</Control>
With a stripped down version of the Custom Action like:
[CustomAction]
public static ActionResult ValidateDatabase(Session session)
{
session.Log("Begin ValidateDatabase");
session["Validated"] = "1";
return ActionResult.Success;
}
The problem I face is that the Next button does not re-enable itself after the Custom Action has run. I can confirm that the CA does run, and the property is successfully set. The UI will update if I do some other action that causes it to refresh, e.g. go back a page then forward to this page again and the Next button will be enabled.
Any ideas on how to refresh a buttons state after a Custom Action?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…