Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Feb 03, 2020 5:18 pm

Hello,
We have an issue with select item in the list, please see code below
Code: Select all
var choiceListField = field as XfaChoiceListField;
                        switch (choiceListField.Name)
                        {
                            // Country
                            case "DataSource[0].Page1[0].Subform3[0].DropDownList2[0]":
                                // choiceListField.Items is empty list
                                // choiceListField.SelectedItem  is null
                                choiceListField.SelectedItem = bank.GeneralCountryID ?? string.Empty;
                                break;


in choiceListField.GetEvents() we have following:
Code: Select all
<event activity="initialize" name="event__initialize" xmlns="http://www.xfa.org/schema/xfa-template/2.8/"><script contentType="application/x-javascript">var selection = xfa.event.newText;
// if the list has text and value data for each item, then enable this line to get the value associated with the item
selection = this.boundItem(selection);

// reset the second list
DropDownList2.clearItems();
DropDownList2.addItem("","");
DropDownList2.addItem("AD,Andorra","AD");
DropDownList2.addItem("AE,Utd.Arab.Emir.","AE");
DropDownList2.addItem("AF,Afghanistan","AF");
DropDownList2.addItem("AG,Antigua/Barbuda","AG");

.......

How can we select an item? Is it possible to do with this lib?

Thanks

impartx
 
Posts: 4
Joined: Mon Jun 18, 2012 5:04 pm

Tue Feb 04, 2020 3:36 am

Hi,

Thanks for your inquiry.
To help us investigate further, please provide your input PDF file. You could upload it here or send to us(support@e-iceblue.com) via email.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Feb 07, 2020 9:46 am

Betsy.jiang wrote:Hi,

Thanks for your inquiry.
To help us investigate further, please provide your input PDF file. You could upload it here or send to us(support@e-iceblue.com) via email.

Sincerely,
Betsy
E-iceblue support team


Hi,

We sent to email the pdf file 3 days ago. Do you have any news?

Thanks

impartx
 
Posts: 4
Joined: Mon Jun 18, 2012 5:04 pm

Fri Feb 07, 2020 9:58 am

Hi,

Sorry that we don't receive your email.
Could you please send it again? Note the email has limitation on attachment size. If your file size is too big, the email might not be sent successfully. In this case, please upload your file on a tool(e.g. OneDrive) then provide a download link.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Sat Feb 08, 2020 9:33 pm

Betsy.jiang wrote:Hi,

Sorry that we don't receive your email.
Could you please send it again? Note the email has limitation on attachment size. If your file size is too big, the email might not be sent successfully. In this case, please upload your file on a tool(e.g. OneDrive) then provide a download link.

Sincerely,
Betsy
E-iceblue support team



Hi,

We have sent from hotmail with link to file shared in one drive.

Thanks

impartx
 
Posts: 4
Joined: Mon Jun 18, 2012 5:04 pm

Mon Feb 10, 2020 2:44 am

Hi,

Thanks for your file.
I have noticed the item cannot be selected. I have posted your issue to our Dev team with the ticket SPIREPDF-3036 for further investigation.
If there is any update, we will let you know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Feb 14, 2020 6:35 am

Hi,

Thanks for waiting.
After further investigation, I regret to say our product cannot select item in the list of your PDF successfully. In your PDF, there is JavaScript which could initialize values for the XfaChoiceListField. After setting the item forcibly with Spire, when opening the result file the JavaScript will initialize values again, then the set value will be overwritten. Unless our product could change the xml data of XFA dict. Yet our product cannot do that at present.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Feb 14, 2020 3:54 pm

Betsy.jiang wrote:Hi,

Thanks for waiting.
After further investigation, I regret to say our product cannot select item in the list of your PDF successfully. In your PDF, there is JavaScript which could initialize values for the XfaChoiceListField. After setting the item forcibly with Spire, when opening the result file the JavaScript will initialize values again, then the set value will be overwritten. Unless our product could change the xml data of XFA dict. Yet our product cannot do that at present.

Sincerely,
Betsy
E-iceblue support team


Hi,

Is it possible to set the item forcibly with Spire and remove the JavaScript with Spire to prevent initialize values again on opening?

Thanks

impartx
 
Posts: 4
Joined: Mon Jun 18, 2012 5:04 pm

Mon Feb 17, 2020 2:15 am

Hi,

Sorry for late reply as weekend.
Sorry that our product cannot do that at present.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF

cron