Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Added action is disabled in XML source on a PDF form

Avatar

Avatar
Boost 1
Level 1
TK0215
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
TK0215
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
TK0215
Level 1

22-03-2021

Hello, I am working with AEM Designer to map a PDF form and use actions on the form.  I added two text field objects and bound data to each of them.  Then I added an action to set the value of one of the fields to null if the other field is not empty.  I am able to save the action and do not get any errors, but upon previewing the form, the action does not work.  In the XML source, I noticed that the action was added as a comment:

//+ Type: Action
//+ Result1: SetFieldValue("$Node2","tonull","")
//+ Node2: FormType[0].Page1[0].Make[0]
//+ Node1: FormType[0].Page1[0].Vin[0]
//+ Condition1: TextField("$Node1","notempty","")
//+ ActionName: Vin.exit
if ((this.resolveNode("$").rawValue != null && this.resolveNode("$").rawValue != "")) {
this.resolveNode("Make").rawValue = null;
}
//-

Can anyone tell me why the action was commented out?  This is the first time I am working with actions so I am wondering if maybe there is some other form setting that I am missing?  Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
Employee
Kosta_Prokopiu1
Employee

Likes

151 likes

Total Posts

341 posts

Correct Reply

97 solutions
Top badges earned
Establish
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Establish
Employee
Kosta_Prokopiu1
Employee

Likes

151 likes

Total Posts

341 posts

Correct Reply

97 solutions
Top badges earned
Establish
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Kosta_Prokopiu1
Employee

23-03-2021

Hi, it is NOT commented. // are line comments and not comment ranges. The actual code line is active. When I do the same thing here it works as expected. The way this is done is that on exiting the field in the action (here Vin) the code gets executed. So you must exit Vin before you see the result.

Kosta_Prokopiu1_0-1616488774902.png

Before Exit:

Kosta_Prokopiu1_1-1616488839533.png
After Exit:

Kosta_Prokopiu1_2-1616488869525.png

The action:

Kosta_Prokopiu1_3-1616488895007.png

 

 

Answers (2)

Answers (2)

Avatar

Avatar
Establish
Employee
Kosta_Prokopiu1
Employee

Likes

151 likes

Total Posts

341 posts

Correct Reply

97 solutions
Top badges earned
Establish
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Establish
Employee
Kosta_Prokopiu1
Employee

Likes

151 likes

Total Posts

341 posts

Correct Reply

97 solutions
Top badges earned
Establish
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Kosta_Prokopiu1
Employee

24-03-2021

@TK0215 Different situation - it is a print PDF that you fill based on incoming data. Here my assumption: The data can contain both data values, if it does then VIN shall take precedence and clear field make. You have to remove the current action as it will not help you. A simple form with 2 text field. I simulate your data by using the Default value for both fields. In the initialize event of the field VIN I check the content and empty Make if it is filled.

Kosta_Prokopiu1_3-1616597456408.png

 

Preview as Print, no logic applied, both fields show content

Kosta_Prokopiu1_1-1616597256238.png

With logic in Initialize of Vin


if (this.rawValue != null && this.rawValue != "") {
Make.rawValue = null;
}

Kosta_Prokopiu1_2-1616597353120.png

If Vin is empty then

Kosta_Prokopiu1_4-1616597487079.png

 

 

 

Avatar

Avatar
Boost 1
Level 1
TK0215
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
TK0215
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
TK0215
Level 1

23-03-2021

Thank you for the clarification.  In that case, perhaps I should provide more context because it is still not working for me.  We build static PDF forms in AEM Designer that get rendered through AEM servers with XML data based on a data schema.  For this test, I mapped a form with the two fields and added the action on one of the fields.  When I do a Preview PDF from within AEM Designer, the action does not work.  I even tried changing the order of the fields in the hierarchy and it still did not work.  Here is my action:

TK0215_0-1616529863327.png

 

And here is the result in Preview PDF:

TK0215_1-1616529903433.png

 

Any thoughts on why it does not work in Designer?