Click on any phrase to play the video from that point.
[♪ Music ♪]
[Adobe LiveCycle ES2]
Hi, this is Dwayne Nichol from Adobe.
One of the things I've been showing lately is the new series
of tools available with LiveCycle ES2.
One of the most impressive tools will be for those who design forms
using LiveCycle ES2 designer.
The LiveCycle ES2 designer is where you build PDF interactive form objects
and allow scripts to be placed in the forms that can control behavior of the form
including things like visibility or what elements get presented
or what form fields become mandatory, et cetera.
For the uninitiated, this is a screenshot of Adobe LiveCycle ES2 designer.
To open up the form or create a new form it's very easy.
You either use the control N or the new form from the wizard.
I'm going to open up a form that I created but haven't yet added any objects to.
So, this is a completely blank form.
Over on the right hand side you have a number of objects you can draw upon.
So, these include things like date and time fields, drop down lists et cetera
and commonly used items like text field, so we can drag a couple of text fields on here.
And let's not put a table on, let's just grab another text field.
And we could then start adding effective customer behavior to it.
So, we could say gender and then the object here we could say male and female,
and then we'll add in other for those who aren't sure.
Now, if we wanted to normally start scripting on this, we could simply select the item,
go up here, and into the script editor start writing our JavaScript,
and this was a bit difficult for some beginners to master.
So, what Adobe has done is put a small tool in called action builder.
Action builder allows you to create actions and the scripts for them
based on a simple interaction model.
So, we can start with a new action, and we'll say on this one
when the drop down list field 1 is changed, we could set the value of a object,
and we'll set the value of text 1 to be--the value field drop down list.
Click okay.
Now, just to make sure this is good, we'll say "You selected" and then reflect the value here.
And this should work.
To test it, you simply go to the PDF preview, and we come to our newly initialized form
and we click "Male" and it says "You've selected male."
Of course, if we redo this it changes it to reflect this.
Another common thing is you would have a subfield that wouldn't be visible
until somebody has actually requested it.
So, say this one was a field that was dependent on the pregnant condition
of somebody, whether or not they are currently pregnant.
You wouldn't want to ask this for males, so what we could do is we could,
and of course, this would normally be a drop down list too which would say yes or no,
we would take this and we could, again, hide it.
We could say with the action builder we'll build a new action.
When object, and from our hierarchy, and you notice the hierarchy here of objects
is roughly the same as the hierarchy here.
There is some additional information here that we have in the designer view
that's not in the action builder view, but anything that's scriptable
will generally be available here.
So, we'll say "When form one has finished loading, show or hide in object."
So, we'll say "TextField2" will be invisible.
And when it loads up, this will now be the case.
Now, to finish this form off, right now we have the raw scripting done thanks to action builder,
and if we want to go look at this we can take a look down at the code.
And you can see that in the change event we can go down to this,
and it will show drop down list change, as noted right here.
It's going to run JavaScript on the client.
This is being generated, and this generated code block should not be modified or extended.
So, we just want to leave this as is for the most part.
What we would want to do though is make this question that poses "Are you pregnant?"
available only if the gender selection is female, and you can't quite do this with action builder
right now, so we can say if DropDownList1 is changed, but we can't say
if drop down list raw value equals female, and that's really what we want
because we don't want just when it's changed because that includes the male
and other choices as well.
So, that leaves us with the option of having to go in and do some scripting.
So, to do this, we're going to show the mouse exit event,
and I'm just going to write a very, very simple couple lines of code here,
and this is an if () statement, and the syntax for this is roughly the same
no matter what language you write it in.
So, whether it's Java or if you work with ActionScript, it's very similar.
So, this is the condition, so if this result, we want to get access to DropDownList1,
which is the literal name of it, .rawValue and we're going to test that
using the double equal signs to see if it equals the literal string female.
And if it does that, if and only if that is true, we're going to say
let's resolve the node of the TextField2 and set its present property to equal,
and this is just a single quote here because we're setting the value,
and we have to feed it a literal string here.
So, we'll set it to visible.
So, the effect this will have now is when we load up the form,
the question that says "Are you pregnant?" is not visible when you select male.
This particular field represents and reflects what was chosen,
but when you click the female and exit it, the pregnant question pops up to you
and of course, this shouldn't be a text field.
It should probably be another drop down with a choice of yes or no.
And if yes, you probably want to ask some other questions.
How long and for any special conditions, et cetera, et cetera.
I'm Dwayne Nichol for Adobe Systems.
This is another quick tutorial on using LifeCycle ES2 designer.
Thank you very much.


