Create Event Handler to Update Button Status Imprimir este apartado Página anterior Subir un nivel Página siguiente

Inicio >  Referencia del programador > ActiveX Integration > ActiveX Integration Examples > HTML > HTML Integration at Document Level >

Create Event Handler to Update Button Status

Availability of a command may vary with every mouse click or keystroke. The custom event OnUpdateCmdUI of XMLSpyControl gives us an opportunity to update the enabled/disabled state of buttons associated with XMLSpy commands. The method XMLSpyControl.QueryStatus is used to query whether a command is enabled or not.


<!--  custom event 'OnUpdateCmdUI" of XMLSpyControl object  -->
function objXMLSpyX::OnUpdateCmdUI()
  if ( document.readyState == "complete" )// 'complete'
    // update status of buttons
     btnWellFormed.disabled =  ! (objDoc1.QueryStatus(34049) & 0x02);   // not enabled
     btnValidate.disabled =  ! (objDoc1.QueryStatus(34174) & 0x02);   // not enabled


© 2019 Altova GmbH