Expand my Community achievements bar.

Set Attached File name to Table Cell

Avatar

Level 2

Hello All,

I have a scenario where:

1. I have a dynamic table.

2.Every Row has a Button for attaching the new File.

3. When we add new Row to the Table, I want to get the attached file name in the corresponding cell. i.e Cell2 in following example.

I have tried doing it this way

Screen36.jpg

The script which I'm using on Add button is

app.execMenuItem("AddFileAttachment");

var o = event.target.dataObjects;

var n = "";

DataNode.Table1.Row1.Cell2.rawValue = "";

if (o !== null) {
          for (var i = 0; i < o.length; i += 1) {
                    n = o[this.parent.index].name;
          }
}

var countVal = (DataNode.Table1.Row1.instanceManager.count-1);

xfa.resolveNode(&quot;DataNode.Table1.Row1[&quot;+countVal+&quot;].Cell2&quot;).rawValue = n;

 

  But I'm not able to display the attached file name in Cell2 of the Table.

How can we do it?

Thanks and Regards,

Nikhil

2 Replies

Avatar

Level 2

Hello All,

I even tried doing the same using  http://eslifeline.wordpress.com/2009/04/06/adding-attachments-to-pdf-form/

But I'm not able to add the file name to the table cell.

Can anyone please guide me through this?

Thanks and Regards,

Nikhil Joshi

Avatar

Level 8

Try this instead of name (I'm assuming your code works and that the actual name comes through in your Cell2):

n = o[this.parent.index].path;

Kyle