Emptied fields reappear after save.

Avatar

Avatar
Give Back 3
Level 2
past-tense
Level 2

Likes

9 likes

Total Posts

85 posts

Correct reply

10 solutions
Top badges earned
Give Back 3
Give Back
Validate 1
Boost 5
Boost 3
View profile

Avatar
Give Back 3
Level 2
past-tense
Level 2

Likes

9 likes

Total Posts

85 posts

Correct reply

10 solutions
Top badges earned
Give Back 3
Give Back
Validate 1
Boost 5
Boost 3
View profile
past-tense
Level 2

04-08-2011

Hey everyone,

I've come across a weird behaviour in all of my dynamic .PDF forms. The following describes the conditions that cause the issue that I'm having:

- A user opens one of the 'reader extended' dynamic forms that I've made.

- They fill out the form and save it.

- They delete the contents of one or more of the fields (so that a field that had content in it is now empty), and save it again.

- They close and reopen the form.

Once they have reopened the form, the field(s) that they cleared still has the same content as from before they cleared and saved it.

This behaviour is consistent across all of my 'reader extended' dynamic .PDF forms. What's interesting is that if the contents of the field are changed (not just removed) the changes are saved. It's only the emptied fields that revert to their previous content.

A work around that I've informed my users about is to put a space in the emptied fields. That way, the field value is saved as a space, and the contents do not revert to their previous content.

If I didn't explain something well enough, please let me know. I don't understand why this would be happening. I don't have any formcalc scripts tht modify the contents of fields... I just have some repeatable subforms.

I'd really appreciate some help here.

- Scott

View Entire Topic

Avatar

Avatar
Give Back 3
Level 2
past-tense
Level 2

Likes

9 likes

Total Posts

85 posts

Correct reply

10 solutions
Top badges earned
Give Back 3
Give Back
Validate 1
Boost 5
Boost 3
View profile

Avatar
Give Back 3
Level 2
past-tense
Level 2

Likes

9 likes

Total Posts

85 posts

Correct reply

10 solutions
Top badges earned
Give Back 3
Give Back
Validate 1
Boost 5
Boost 3
View profile
past-tense
Level 2

05-08-2011

Alright, I've done some extensive testing, and I've found out the precise cause of this behavior. It doesn't occur on all fields, just the ones that are set to accept rich text.

I've taken a peek at the XML behind the fields as their values are edited. All text fields start with just the following:

<?xml version="1.0" encoding="UTF-8"?>

once the value has been edited then cleared, the XML becomes:

<?xml version="1.0" encoding="UTF-8"?>

<value override="1" xmlns="http://www.xfa.org/schema/xfa-template/3.0/">

     <exData contentType="text/plain"/>

</value>

I think that this left over artifact causes livecycle to revert to some internally sotred exData value, and that the only way to overwrite it is to change the content, forcing the new data to be stored in the internal exData.

I've tried using:

.value.loadXML('<?xml version="1.0" encoding="UTF-8"?>',0,1);

... I was hoping that this would overwrite the value back to null, but it didn't work. So far, the best that I've come up with is this (in the preSave code):

for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++)

{

var oFields = xfa.layout.pageContent(nPageCount, "field");

var nNodesLength = oFields.length;

for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++)

{

if (oFields.item(nNodeCount).rawValue == null || oFields.item(nNodeCount).rawValue.length == 0 || oFields.item(nNodeCount).rawValue == "")

{

oFields.item(nNodeCount).rawValue = " ";

}

}

}

This checks all fields to see if it's empty, if it is, it enters a space into the field. I would like to further refine this code to only update those fields that are set to accept rich text, but I can't see any attribute where that is stored. 'getAttribute' might be what I'm looking for, but without knowing the name of the attribute, I'm lost.

I would also like to find some other way (besides putting in a space) to fix the issue. I hate that all my empty fields have to have a space in them.

I would appreciate it if anyone knew a solution the the two issues posted above.. Also, is this a bug? Should I report this, and if so, where do I go to report it?

Thanks for any help you might be able to offer,

- Scott