Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

How to bind data to ListBox, so that data can be exported and imported?

Avatar

Level 1

Listbox.png

form1.#subform[0].Button1::click - (FormCalc, client)

form1.#subform[0].ListBox1.addItem("aa")

form1.#subform[0].ListBox1.addItem("bb")

How to bind data to ListBox, so that data can be exported and imported?

11 Replies

Avatar

Level 10

Hi,

Can you give some more detail about what you are trying to do.  The code you have shown will add items to the list box, but what do you mean by export or import. Do you want to link the items to an external data source?

Avatar

Level 1

Hi,

You are correct, I will use external data source, for example:

I have created a dynamical pdf file with Listbox and a button.  after adding items by clicking the button,  I would like to export the data to ohters who has the same file. by importing the date which i share,  he shall get the same with what I have in my computer.

for example, binding data to Editbox, I used a xsd file below,

<xsd:complexType name="deliveryType">

  <xsd:sequence>

   <xsd:element name="companyName" type="xsd:string"/>

   <xsd:element name="address"     type="xsd:string"/>

   <xsd:element name="city"        type="xsd:string"/>

   <xsd:element name="stateProv"   type="xsd:string"/>

  </xsd:sequence>

</xsd:complexType>

some thing like below, it workds

<xsd:complexType name="itemType">

  <xsd:sequence>

   <xsd:element name="item" minOccurs="0" maxOccurs="unbounded">

    <xsd:complexType>

     <xsd:sequence>

      <xsd:element name="partNum"     type="xsd:string"/>

      <xsd:element name="description" type="xsd:string"/>

      <xsd:element name="quantity"    type="xsd:positiveInteger"/>

      <xsd:element name="unitPrice"   type="xsd:float"/>

     </xsd:sequence>

    </xsd:complexType>

   </xsd:element>

  </xsd:sequence>

</xsd:complexType>

it works for Text fields. but i don't know how to bind to ListBox.

I have tried some many time, but failed

when I click the button, the ListBox will be add items, but when I export the data, the data will not include all items in the ListBox.

for short, I would like the data showing all items in the ListBox, not only the default value but also the other value added by button.

Many thanks for your reply.

Best regards.

Avatar

Level 1

Good Mooring  BR001,

if we add Row instance, we can bind data something like <xsd:element name="item" minOccurs="0" maxOccurs="unbounded">,

but if we add a page instance, how shall we bind the data to the Text fields in the dynamic pages

$.item.item[*].Cell1 will work for Row instance

but it does not work for page instance.

Remarks: I created a dynamic pdf, I want to add pages dynamicly, and the page inclue Text fields, ListBox, Tables, maybe it is very difficult to bind data to ListBox, how shall we bind the data to the Text fields in the dynamic pages

Many thanks

Best regards

Avatar

Level 10

The ListBox will only export the items that have been selected, if you want to export the items in the ListBox you might be better off using a simple repeating text field.

I'm not sure what you mean by adding a page instance, this sounds like something you would do when designing your form.

Maybe if you could share your form it might make things clearer, could you upload your form to a file share site and add a link to it here.

Avatar

Level 1

https://pan.baidu.com/s/1ahT6udk63RM0AvSdLJbesg&shfl=sharepset

pls find test pdf

from index page, clicking A or B or C will add new Row, new Page, and will navigate to new page, put some commets in the new page.

and again click clicking A or B or C to add new Row, new Page and new comments

after some time this file will get more information

so i would like to export and import data for maintenance

Kindly advice on exporting and importing date will repeating pages.

Avatar

Level 10

Wow, what do I click on in that page.  Is there a file sharing site that has an English option

Avatar

Level 1

1845625_pastedImage_0.png

Pls click the button showing on the picture

Avatar

Level 1

Hi, BR001,

Have you downloaded that test pdf?

Avatar

Level 10

That button just popped up a dialog that had even less clues as to what was going on.

Avatar

Level 1

Pls open this link,

https://pan.baidu.com/s/1ahT6udk63RM0AvSdLJbesg&shfl=sharepset

and you will find a popup window as showed in the screenshot above, and pls click the button as showed above in the popup window to download, then click below second button to save.

Many thanks.