Reputation: 443
Just wondering if it is possible to set a ribbon rule which shows/hides a button group on a form based on the certain values on that form in realtime
(I want ribbon button to be hidden if a value is missing/changed/removed from the form but before the form is saved)
While I understand that it is possible to have the ribbon run custom JavaScript, i was wondering if the JavaScript is only triggered on form load or whenever certain field values have been changed?
Upvotes: 2
Views: 869
Reputation: 5352
The refreshRibbon()
function exists precisely for this purpose, and can be triggered on a field change event, but unfortunately, it only works for EnableRules
, not DisplayRules
. (See a very recent question for a similar problem.)
This function is typically used when a ribbon
<EnableRule>
(RibbonDiffXml) depends on a value in the form. After your code changes a value that is used by a rule, use this method to force the ribbon to re-evaluate the data in the form so that the rule can be applied.
Upvotes: 3