I have created a GUI extension and added it to both Ribbon bar and Context menu.

Extension is working, but disabling it when "inappropriate" item is selected is creating a challenge.

I have set isEnabled (in the .js) to return false when publication/folder is selected. This is working nicely in the main view, but not in the tree view.

In the tree view, for Context menu it is working (extension is grayed out), but it is not working for Ribbon button. Button is always enabled (although when you click it while "inappropriate" item is selected it doesn't do anything).

How do I set enabled/disabled status for Ribbon button when items in tree view are selected?

  • 4
    This question appears to be off-topic because it was caused by a unspecified JavaScript error. Future visitors are very unlikely to be helped by this answer. Sep 29, 2014 at 15:44
  • To help get answers and to help future visitors, please post any errors you're getting in the browser console. Your code can also provide context on what you're trying to achieve. Sep 29, 2014 at 20:07
  • Answer updated with error details (although I am not sure if this will be helpful to future visitors as problem was caused by a a silly mistake of calling an object method when there is no object :) ) Oct 1, 2014 at 9:12

1 Answer 1


It seems that I was having javascript error due to which isEnabled was not returning a value. After this has been fixed, everything is working as expected.

Update: Error was caused by selection.getItem(0).getItemType(). This was throwing an error when items where selected from the tree view. Solved by checking if item!=null before getting item type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.