Change 'command' in a binding using xbl:inherits

69 views Asked by At

I'm making an application that runs in XULRunner on Windows.

There I created the browser-toolbar binding that will be used in different places. While the binding needs to look the same it should execute different commands on button clicks.

I'm trying to accomplish it like this (code is simplified, namespaces are dropped):

<binding id="custom-browser-type-a">
  <content>
    <commandset>
      <command id="TypeA:Home" oncommand="home()"/>
      <command id="TypeA:Back" oncommand="back()"/>
    </commandset>
    <browser-toolbar cmd_home="TypeA:Home" cmd_back="TypeA:Back" ... />
    <browser/>
  </content>
  <implementation>
  ...
  </implementation>
</binding>

<binding id="browser-toolbar">
  <content>
    <toolbar>
      <toolbarbutton label="Home" xbl:inherits="command=cmd_home"/>
      <toolbarbutton label="Back" xbl:inherits="command=cmd_back"/>
      ...
    </toolbar>        
  </content>
</binding>

Once clicked a toolbarbutton execute an assigned command just fine. The problem is when I disable a command it doesn't affect the disabled state of a corresponding toolbarbutton, it stays enabled. Does anyone have any idea why that is not working?

Thank you!

0

There are 0 answers