How do you call control event code from LiveCycle JavaScript?

1,094 views
Skip to first unread message

Trevor Feldman

unread,
May 2, 2008, 12:41:32 PM5/2/08
to Adobe LiveCycle Developers
If you have a JavaScript function (or functions) that you want to
reuse, I know you can create a Scripting Object and put it in there.

However, if you want to create a custom object library group - I can
only see a way to create custom controls - not Scripting Objects -
that can be dragged onto a PDF. So it would be helpful know either:

A) How do you put a Scripting Object into a custom library group
(either by itself or with other controls) so that it can be dragged
into a PDF?

or

B) How do you call JavaScript code included in an event for one
control from an event in another control?

Please let me know if you know how to do either. Thanks in advance
for your help!

Trevor Feldman
BD

Srinath Subramanyan

unread,
May 2, 2008, 9:56:45 PM5/2/08
to live...@googlegroups.com
i hope this wuld answer ur second question

<controlname>.execevent("<eventname>")
ex:
Button.execevent("click");

thus the click event of the button can be executed from any other event.
--
srinath
9841942055

fred.pantalone

unread,
May 3, 2008, 5:54:04 AM5/3/08
to Adobe LiveCycle Developers
-Create the script object;
-Right-click on it;
-Save it as a fragment (i.e. "create fragment");
-It's now available for use in other forms in the "Fragment Library".




On May 3, 2:56 am, "Srinath Subramanyan" <srinat...@gmail.com> wrote:
> i hope this wuld answer ur second question
>
> <controlname>.execevent("<eventname>")
> ex:
> Button.execevent("click");
>
> thus the click event of the button can be executed from any other event.
>
> On Fri, May 2, 2008 at 10:11 PM, Trevor Feldman <thfeldma...@gmail.com>

Trevor Feldman

unread,
May 6, 2008, 11:45:02 AM5/6/08
to Adobe LiveCycle Developers
Thank you Srinath - your answer to question B) worked for me!

Re: Fred's response, I could not see an option to save or create a
fragment or create Fragment Library. Is this something that requires
LiveCycle Forms ES on the server - or can it be done in LiveCycle
Designer on a client that is not tied to a LiveCycle ES server?
(Fred: thanks for your suggestion.)
> > 9841942055- Hide quoted text -
>
> - Show quoted text -

fred.pantalone

unread,
May 7, 2008, 11:48:26 AM5/7/08
to Adobe LiveCycle Developers
Hi Trevor,

I'm running LC Designer ES v8.1.1.silly.bunch.of.numbers. Are you
using the Designer that came with Acrobat Pro?

If so, here is an approach you can use to add scripts to the library:

-create a subform and name it something descriptive of the scripts;
-make the subform "invisible";
-in the "Hierarchy View", right-click on the subform and select
"Insert Script Object";
-give the new script object a name;
-place your JavaScript functions in that script object;
-in the "Design View", right-click on the subform and select "Add to
Library...";
-provide a good name and description;
-create a whole new form;
-drag the new library object onto the form;
-call the functions of that object's script object like so:
subformName.variables.scriptObjectName.functionName();
-you're done!

Note that, after dragging it onto the form, you may want to make the
library object "hidden" instead of "invisible".
Reply all
Reply to author
Forward
0 new messages