I use 'Label Add Event', and I need to get the page id.
How can I do it in 'event listeners'?
I have Confluence version 6.13.8
Tnx,
Daniel
Hi @Daniel R_,
your approach is correct but, according to HTML specs, the select tag in HTML doesn't have a readonly attribute, only a disabled attribute; so it doesn't work. A good workaround to do this, is the following:
def childElement = getFieldById("customfield_13062:1")
// To Disable
childElement.setDescription("<style onload=\"document.getElementById(\'customfield_13062:1\').setAttribute(\'disabled\',\'\')\"></style>")
// To Enable
//childElement.setDescription("<style onload=\"document.getElementById(\'customfield_13062:1\').removeAttribute(\'disabled\')\"></style>")
Sadly it appears that ScriptRunner's Behaviour getFieldById is not correctly sanitized and will throw an exception if trying to select a field with a colon in it's name.
Thanks for your help anyway.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.