Forum Discussion
ianreid while you cannot 'disable' the buttons, what you can do is create a parameter for each button
e.g. pm_btn_RunCalc_isEnabled
Then in the dashboard extender code where you would "disable" the button specify:
taskResult.ModifiedCustomSubstVars.Add("pm_btn_RunCalc_isEnabled", "False")
taskResult.ModifiedCustomSubstVars.Add("pm_btn_RunCalc_TextColor", "XFLightGray ")
Enabled:
taskResult.ModifiedCustomSubstVars.Add("pm_btn_RunCalc_isEnabled", "True")
taskResult.ModifiedCustomSubstVars.Add("pm_btn_RunCalc_TextColor", "#FF000000 ")
In the Selection Changed Server Task Arguments for the button, add to the third set of {} braces:
{IsEnabled=|!pm_btn_RunCalc_isEnabled!| ...<other params>}
Then in the dashboard extender code that handles the button click for the param you just set:
If args.NameValuePairs("IsEnabled", String.Empty).Equals("True") Then
<call to function or sub that runs your calc>
End IF
This was if IsEnabled = False (or anything other than "True"), the Dashboard Extender will exist without doing anthing, giving the appearance of a diabled button.
You can use parameters the same way to change the format of the button to use black when "enabled" and XFLightGray when not enabled. Display Format: TextColor=|!pm_btn_RunCalc_TextColor!|
Parameters give you all the flexibility you need to accomplish this.
Related Content
- 5 months ago
- 10 months ago
- 5 months ago