[Xsltforms-support] XSLTForms Disable Button (Trigger)
Brought to you by:
alain-couthures
From: Sachin G. <sac...@co...> - 2011-07-13 16:45:59
|
Hi, I am having issues while I am trying to disable a trigger in XSLTForms: Binding: <xf:bind nodeset="instance(''i0'')/@hasSubject" readonly="not(boolean-from-string(.))" id="findPersonButtonBinding"/> Trigger: <xf:trigger bind="findPersonButtonBinding" appearance="full"> <xf:label>Find</xf:label> <xf:load resource="javascript:MOSAIC.util.showFindPerson()" ev:event="DOMActivate"/> </xf:trigger> It doesn't disable the button. So I did following: XFTrigger.prototype.changeReadonly = function() { if(this.readonly) { var button = Core.isXhtml ? (this.element.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "a")[0] || this.element.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "button")[0]) : (this.element.getElementsByTagName("a")[0] || this.element.getElementsByTagName("button")[0]); if(typeof button.disabled != "undefined") { button.disabled = "disabled"; } else if(button.href) { button.removeAttribute("href"); } } }; It seems to disable the button, is it the right approach? Cheers Sachin Sachin Goyal Java Developer Corelogic Limited www.corelogic.co.uk <http://www.corelogic.co.uk> Tel: 0131 550 0445 Mobile: 07779 393 392 Email sac...@co... <mailto:sac...@co...> This document should only be read by those persons to whom it is intended, and its contents are private and confidential. If you receive this email message in error, notify the sender immediately and do not disclose, copy or distribute this message, or open any attachments Please consider the environment - do you really need to print this? |