Hi Guys,
I have a small problem. Actually I thought everything works perfect but as i saved or sent the form and opened it again the populated information was gone. I was shocked.
I give you short function of my form.
I type in texfield "Type" "a" or "b" a dropdown list with A, B, C appears. If I select A ,B or C or all of them then this information appears in a list box. that's perfect so far, but when I save this pdf file or send it to someone and open it, then the selected information is gone. this is horrible!
Does anyone know what's going on wrong??
I think the information should remain otherwise the function doesnt make sense.
I appreciate it a lot if someone can help me to solve this problem!
Thanks in advance!
Diana
Solved! Go to Solution.
Views
Replies
Total Likes
You are chganging the state of the form in script. When you save it those changes are not being saved because your code does not do that. You can have the form save those changes for you so you do not have to worry about it. This is controlled in the File/Form Properties menu. Choose the Defaults tab and change the "Preserve scripting changes" radio button to Automatically then try it again (see the image below).
Paul
Views
Replies
Total Likes
You are chganging the state of the form in script. When you save it those changes are not being saved because your code does not do that. You can have the form save those changes for you so you do not have to worry about it. This is controlled in the File/Form Properties menu. Choose the Defaults tab and change the "Preserve scripting changes" radio button to Automatically then try it again (see the image below).
Paul
Views
Replies
Total Likes
Thank you so much!!!!
It works, I cant believe:))
Diana
Views
Replies
Total Likes
Hey Paul,
i have just one another question concerning the same form.
i want to populate the information from the first listbox to another listbox with this code :
Com1.addItem(xfa.event.newText)
;
and it populates, but only if i click on the items from the first listbox.
do you know why it's happening?
Thanks in advance!
Diana
Views
Replies
Total Likes
You have the code on the change event. The change event is fired when the user selects something
in the list box and "changes" the value. When do you want to add the item to the 2nd list box?
Paul
Views
Replies
Total Likes
Well, the second listbox will be on another form and should be filled in when the first form has been already filled and sent back. Unfortunately I cant directly fill my selection from the dropdown list into both listboxes.
I tried this code in exit, but it doesnt populate at all.
Thanks for ur answer!
Diana
Views
Replies
Total Likes
You can assign the xfa.event.newText to a variable then you can reuse the var as required and you can set each of the listboxes according. The code would look something like this:
var ListBoxSelection = xfa.event.newText;
Com.addItem(ListBoxSelection);
Com1.addItem(ListBoxSelection);
Or I have completly misunderstood why you cannot set both ListBoxes.
paul
Views
Replies
Total Likes
The reason why I cant populate the information from the dropdown list in 2 list boxes simultaneously, is because the second list will be on a second form. and only if i push a button create the second form the information from the first list box should be populated in the second listbox.
the reason is, that different people will select items from the dropdown list and populate it in the first listbox. after gathering these information they should appear in a new form in the second listbox.
I hope didnt explain it confusing
Thanks,
Diana
Views
Replies
Total Likes
So you cannot push information from one form to another via script. The only way you
will be able to get close is if you export the data then import to the new form.
Make sense?
Paul
Paul, thank you in advance for all your help. It does make sense, and following your tip, I tried using the Distribute Form in LiveCycle, but the problem is that the dataset for some reason does not display the values contained in the listbox. The listbox does retain the information after save (thx to your answer) but I don't see it in the dataset file, any ideas?
Thank you again,
Diana
Views
Replies
Total Likes
The data file will only contain the value that the user selected .....it does not make sense to carry along everything else
(in a data file). Maybe you shodul use an alternate method of capturing that information. What about a field that will repeat for each entry that you want?
Paul
Paul, there's only one issue. The idea behind the listbox is to capture the different selections from another dropbox in the form. However, there are over 40 different values in the dropdown, so the listbox may end up with 10 or 15 of those values - these are the values I want to be able to save in the dataset. I don't know what will be the best way to do this, any ideas?
Thank you,
Diana
Views
Replies
Total Likes
What if you put the selected values in a dynamic table. Each selection would add a row to the table and each item in the table woudl be a unique object hence the values woudl be transported in the dataset.
Paul
Views
Replies
Total Likes
Here is an updatetd sample to give you the idea of what I am talking about. You can hit the save data button to see what the submitted data woudl look like.
Paul
Views
Replies
Total Likes
Paul, this is what I needed, thank you very much for all your help, one last question though, if I want to delete one of the items from both the listbox and the dynamically created cell in the table, how would I do it?
Views
Replies
Total Likes
See the attached modified sample.
paul
Views
Replies
Total Likes
Paul, this works but what I would like to do is make the table cells (the text dynamically created) invisible, so the user would not have the second box, both items should be deleted using the remove botton. Somewhat like:
var
x = Com.selectedIndex;
Com.deleteItem(x);
Table_SF._Repeat_SF.removeInstance(x);
this code doesn't work, but hopefully with your help, we could make work
Views
Replies
Total Likes
I think this is what you asked for ......you will also have to check to make sure that the user picked something in the DDlist before deleting
Paul
Views
Replies
Total Likes
Paul, thanks a lot for so much help!!!
it works brilliant
Diana
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies