I have a drop-down list that is being populated by a web service. What I need to do is when a user clicks on a choice in the drop-down it is moved to the list box.
I have the following in a change event of the drop-down list:
lbCompanyCode.addItem(xfa.event.newText);
It works like it should but when I submit the form in LiveCycle the data disappears from the list box.
Any thoughts?
Thank you in advance!
John
Views
Replies
Total Likes
John,
You have happened upon an issue with the ListBox event model. A ListBox has two commit options, select and exit. When you populate the ListBox upon the DropDown change event, you are bypassing both commit options so the ListBox value(s) is not injected into the data model.
Here's what I did to circumvent:
1) on my drop-down change event I added JavaScript to execute my listbox exit event
form1.page1.subform1.listBox.execEvent("exit");
2) on my listbox exit event I added JavaScript to populate the listbox with the drop-down value, iterate over the listbox items for the number of items in the list, and then use 'setItemState' to mimic selection (NOTE, allow multiple selections is enabled on the listbox)
form1.page1.subform1.listBox.addItem(xfa.event.newText);
var listBoxCnt = form1.page1.subform1.listBox.length;
for (i=0; i < listBoxCnt; i++) {
form1.page1.subform1.listBox.setItemState(i,true);
}
My sample is attached.
Steve
Steve,
I followed what you attached and your example worked fine. I don't kno why I can't get mine to work. It seems like the data is not staying in the XML when I click complete in LiveCycle. I used the record and playback and the data is not getting carried into the XML file when the form moves to another step.
Any thoughts?
Thanks,
John
Views
Replies
Total Likes
John,
Sorry, I did not realize that the problem was related to process management. I thought it was submission from Reader/Acrobat to a server.
Is the initial PDF rendered in Workspace?
Is the Form Data Mappings > Input Form Variabe set to the document root in the Assign Task?
Steve
Views
Replies
Total Likes
Steve,
I have it set up correctly and my other data flows over fine, just not the list box. I don't know if its an XML issue or not. I have everything bound correctly.
Thanks,
John Daily
John Daily
Application Systems Analyst III
King Pharmaceuticals, Inc.
Office: 423-989-7165
Cell: 423-956-3911
Views
Replies
Total Likes
@Steve
I had this problem in my form... the solution worked.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies