I think it's an event problem...

76 views
Skip to first unread message

Jono Moore

unread,
Oct 7, 2010, 2:22:22 PM10/7/10
to Adobe LiveCycle Developers
Another one for the hive mind.

Seems to be an event ordering problem.

I'm trying to setup a form so it knows whether or not it's been used
before using a form number field to drive the logic.

I'm trying to give the user three options:
Edit the existing form
Re-use the form (and generate a new order number)
Start a new form (wipe the form clean and start fresh)

On opening the form I have a popup that asks the user what they want
to do if the form already has a number.

I've got the logic for driving the popup and number generation on the
form:ready event of the "hidden # generator" field - outlined in a red
dotted line so it's easy to see while I'm working on it.

Everything works except for the start a new form option.

The logic I started with for generating a new form didn't work:
{
xfa.host.resetData();
xfa.form.remerge();
var d = new Date();
this.rawValue = Math.floor(d / 1000);
}

I've tried creating a script object to handle the resetData() and
remerge() functions which is getting me closer but it doesn't clear
the number field because after the script object fires I get the popup
when I shouldn't.

But even if I explicitly blank the number field it doesn't work:
{
subMain.subHeader.RequestNo.rawValue = "";
xfa.form.remerge();
xfa.host.resetData();
}

The form resets and gets a new number but I get the popup again when I
shouldn't.

scReset is the script object that does the reset routine.

I'm using AcroDialogs to make a pretty popup and the AcroDialogs code
itself is part of the if statement that checks to see if the number
field is empty or not. So the first few lines of the script checks for
value and generates a number if the field is empty, else it drives the
popup - my code for dealing with the popup choices starts at line 182.

Form is here: https://acrobat.com/#d=ZljqS5WWljYSdn1hvO6FbA

Is there a way to do what I'm trying to do or does anyone have a
better idea?

Duane Nickull

unread,
Oct 7, 2010, 2:32:25 PM10/7/10
to Adobe LiveCycle Developers
--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.



---
Adobe LiveCycle Enterprise Architecture - http://www.adobe.com/products/livecycle/
My TV Show - http://tv.adobe.com/show/duanes-world/
My Blog – http://technoracle.blogspot.com/
My Band – http://22ndcenturyofficial.com/
Twitter – http://twitter.com/duanechaos/


Jono Moore

unread,
Oct 7, 2010, 3:21:47 PM10/7/10
to Adobe LiveCycle Developers
Yeah, I know about that stuff - I don't think this is related.

On Oct 7, 11:32 am, Duane Nickull <dnick...@adobe.com> wrote:
> This video might help:http://tv.adobe.com/watch/working-with-adobe-livecycle-es2/configurin...
> For more options, visit this group athttp://groups.google.com/group/livecycle?hl=en.
>
> ---
> Adobe LiveCycle Enterprise Architecture -http://www.adobe.com/products/livecycle/
> My TV Show -http://tv.adobe.com/show/duanes-world/
> My Blog -http://technoracle.blogspot.com/
> My Band -http://22ndcenturyofficial.com/
> Twitter -http://twitter.com/duanechaos/
>
> [cid:3369295945_21043938]
>
>  image.jpg
> 16KViewDownload

Jono Moore

unread,
Oct 7, 2010, 3:22:23 PM10/7/10
to Adobe LiveCycle Developers
Oh, and on the docReady event it almost works - the form resets but a
new number doesn't get generated.

Jono Moore

unread,
Oct 7, 2010, 5:26:44 PM10/7/10
to Adobe LiveCycle Developers
Got it sorted with Niall's help - implemented a hidden button to
handle the number generation that gets activated by the script with an
"execEvent("click")".

We now return you to your regularly scheduled internets.


On Oct 7, 11:22 am, Jono Moore <jono.mo...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages