Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

JavaScript functions across the forms?

Avatar

Former Community Member

Hello,

We are developing set of forms using LiveCycle Designer. The forms are complex and need some involved JavaScripts. I found great feature where we can insert a script object to hold common JavaScript functions and use those anywhere in the form. However, as I need to create some 35 such forms, I was wondering if there is any way of creating a library of JavaScript functions that I can use for all the forms. I.e. I do not want to create Javascript Object per form but want to find out if I can have one JavaScript object that I can reference from all the forms?

Thanks in advance!

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You could drag your script object to the Fragment Library and then pull it back into each form.

Parallels Desktop.png

Niall

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

Hi,

You could drag your script object to the Fragment Library and then pull it back into each form.

Parallels Desktop.png

Niall

Avatar

Level 7

Hi Niall,

Feeling especially lazy today, I thought I'd try asking rather than testing this to find the answer. How does updating scripts in the library work? If I have multiple forms that use a script from the Fragment Library, when I tweak the script and save it, does the tweak change the script in all the forms? If so, does this happen upon reopenning each form in Designer? (i.e. each form still has to be reopened in Designer for the tweak to happen, right?). I feel like an idiot asking, but I'm long in lazyness this miserable, damp, dreary morning in Wisconsin. Even my little dog's energy has waned today.

Cheers,

Stephen

Avatar

Level 10

Hi Stephen,

I know what you mean - we have run out of steam here as well...

Fragments (and Style Sheets in ADEP Designer 10) work best when used with the full Enterprise Suite. The fragment is referenced when the form is rendered.

If working with LC Designer standalone, then yes, you have to open the form to update the reference to the updated fragement. Still it saves a bit of time.

Enjoy the rest of your weekend. We're just about to light the fire here and take it easy for the evening.

Niall

Avatar

Former Community Member

Hello Niall,

Thank you for your response. Stephen, thanks for the additional question, would have been a question from me eventually but you saved me the effort :-) Happy rest of the weekend!

Thanks

Rutuja