Last active
September 15, 2015 16:46
-
-
Save ebruchez/f64812d6fa7cb44b2a47 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_findControl: (controlIdOrElem, formElem) -> | |
[controlId, resolvedControl] = | |
if _.isString(controlIdOrElem) | |
controlId = controlIdOrElem | |
formId = | |
if _.isElement(formElem) | |
formElem.id | |
else | |
$(document.forms).filter('.xforms-form')[0].id | |
ns = ORBEON.xforms.Globals.ns[formId] | |
[controlId, document.getElementById(ns + controlId)] | |
else | |
[controlIdOrElem.id, controlIdOrElem] | |
if not resolvedControl? | |
throw "Cannot find control id #{controlId}" | |
if Controls.isInRepeatTemplate(resolvedControl) | |
throw 'Cannot set the value of a repeat template' | |
resolvedControl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment