2 Replies Latest reply: Sep 28, 2011 6:34 AM by Nathanvdk RSS

    CanEnableContextCommandHandler

    Nathanvdk Community Member

      Suppose I have the following situation: 2 Files and a Custom menu command, with 3 subcommands inside it. Let's say I want to disable the last subcommand on the 1st file, and the first subcommand on the second file. Therefor I've implemented some logic the CanEnableContextCommandHandler. This seems to work correctly in Explorer. When I try this inside Bridge, everything is Ok for the first file. But for the second one, none of the subcommands are shown.

       

      While debugging, I've noticed that when testing this in Explorer, the CanEnableContextCommandHandler is called 3 times for the subcommands. In Bridge, it is only called once. I think it has something to do with the fact that during the first call I set the response.setCanEnable to false?

       

      Could you try this out?

        • 1. Re: CanEnableContextCommandHandler
          Gang_Z Community Member

          Hi,

           

          I cannot reproduce your issue on my side, for your case, I think you should make sure the parent menu command is always enabled in these two cases, even the parent menu command is just an anchor for the subcommands and no real action correlated with it. this is the limitation of Bridge code, the default status for a menu command is false, Bridge will hide all the subcommands in this case.

           

          Gang

           

          Thanks

          • 2. Re: CanEnableContextCommandHandler
            Nathanvdk Community Member

            Turned out that a had a space inside my CommandId, when I changed it to a Id without space, everything works like a charm.