cancel
Showing results for 
Search instead for 
Did you mean: 

Add multiple File Upload UI-Pattern to a Table

0 Kudos

Hello there,

is it possible to use the Standard FileUpload UI element in a table as row element?

That table should initially return (via RFC) a list of required documents to be uploaded into a record model via another RFC.

My idea would be to attach the FileUpload UI element via Table cellEditor as a separate column to the table. Then for each table entry I would select the corresponding file on my local directory. At the end I would press the "upload"-button at the bottom of the table to upload them altogether.

Would that work? I have already tried to implement it. So far the UI-setup seems to work. But I failed to select more than one file with the integrated "browser"-button. As soon as I pressed the browser-button for the second entry in the table it returns an illegalArgumentException.

Much appreciated

Xiaopeng

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Xiaopeng,

What NW version are you using?

My (6.40 SP11/SP13) says that FileUpload control may not be used as cell editor -- it doesn't implement IWDTableCellEditor interface.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

0 Kudos

Hi Valery,

I`m experimenting with a validated version of NW 7.00 SP5.

I simply created a table, attached an additional column to it, inserted a tableCellEditor and selected the fileUpload pattern from the list of available elements.

Although it might not win a beauty contest, it definitely works.

I have no experience with NW 6.40, so I cant really tell what`s different now.

Former Member
0 Kudos

Xiaopeng,

I've tried FileUpload / FileDownload within table on <b>NW04s</b> -- everything works just fine. I were using Resource attribute (rather then obsolete binary attribute) for content.

If you still have problems I may send you example project -- just mail me to vsilaev AT gmail DOT com

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Message was edited by: Valery Silaev

NW version mentioned in text was corrected

0 Kudos

Hello Valery,

thank you very much for the testing. Actually I also used the resource attribute to get the file. It works fine. My idea is however to implement such a fileUpload IU for every table items. Something like the follwing:

Table

Column1 - Column2 - Column3

item1 Name - item1 Type - FileUploadUI for item1

item2 Name - item2 Type - FileUploadUI for item2

item3 Name - item3 Type - FileUploadUI for item3

>>Upload-Button<<

I`d like to select the File-path for every table item and upload them all together. The problem is I have no idea how many items the table will contain.

To my understanding, I have to manually bind a new Resource-Attribute in the View-Context for every FileUploadUI "dataSource". How can I manage this if I have no idea how many (if at all) items I will have in the table I need to provide a UploadUI for?

Xiaopeng

Former Member
0 Kudos

Xiaopeng,

Funny, the sample I've created ressembles your structure exactly (again, I can mail it to you)

But, having an "Upload" button is something... Well, something that will not work as expected. Surem, clicking on this button will force upload of files. However, changing row selection in table will force uploading files as well. So this may confuse user.

Valery Silaev (vsilaev AT gmail DOT com)

EPAM Systems

http://www.NetWeaverTeam.com

0 Kudos

Hi Valery,

thank you again for the example you sent me. I now understand how to create such a UI-pattern. But what seems to be still missing is the upload button. You said the upload will also be triggered, when I change the row selection, however that doesnt seem to work in my test run.

What if, let's say, I have the follwing method:

executeZ_UPLOAD_DOC(String fileType, String fileName, IWDResource).

That method takes the parameters and call the RFC, which will upload the file to system. One for each call.

Now when I press the upload button in my UI-table after I assigned the IWDResource to each row, I obviously have to implement something that calls the uploadmethod for me (for each valid upload entries I have in table). That means I have to create a loop for the method call.

Now here comes the tricky part:

My scenario is to have a table with binding to a node as data source. That node stores a list of items, which is returned by a previous getListRFC. Let's say a list of document descriptions. What i did is, I extended my table by the uploadUI-column, in order to upload the files that match the doc descriptions.

Now, can I loop through the list of doc-items and upload the corresponding IWDSource-Object? I have no idea at design time how many entries the getListRFC will return. So I have to get the size of the node at runtime.

Table

Column 1(Binding) -


|----


Column 2(IWDSource)

Z_Upload.Output.Description.doc1 -- | -


UploadUI(Path to Doc1)---

Z_Upload.Output.Description.doc2 -| -


UploadUI(Path to Doc2)-

Z_Upload.Output.Description.doc3 -| -


UploadUI(Path to Doc3)-

.

.

.

.

>>>Upload<<<Button

If I loop through the size of the node_Z_Upload.Output and get the element at each position, how can I get the corresponding IWDResource each time to call the Uploadmethod?

In other words:

is

wdContext.nodeResource().getResourceElementAt(i).getRESOURCEELEMENT()

the corresponding IDWResource to

node_Z_Upload_Output().getElementAt(i)?

Message was edited by: Xiaopeng Tan

Former Member
0 Kudos

Xiaopeng,

1. Just add an "Upload" button with validating action -- all the files should be uploaded when action handler is invoked.

2. Second (linking output structure & UI) is also simple.

Say you have the following structure by adaptive RFC model:



Z_Upload_Input (0..1)
  +- Z_Upload_Output (0..1)
       +- Description (0..1)
            +- Doc (0..n)

So you have to create node UIInput (cardinality 1..1, singleton false, selection 1..1) as a direct child of Doc node. Create attributes Content (IWDResource), FileName(string) and FileType (string) as in my example.

Now bind table directly to Doc node (table data source), but individual cell editors should be bound to UIInput node attributes.

Next, in action handler you may traverse Doc node, and for every element found call <yourDocElement>.currentUIInputElement(). Here all necessary properties (including binary content) may be accessed.

VS

0 Kudos

Hi Valery,

thank you for the valuable help! I finally got it working.

The decisive hint was the setting of the Resource node (cardinality 1..1, singleton false, selection 1..1). Before changing the setting, I was not able to access it via the doc node. But now it's working.

Thank you again!

best regards,

Xiaopeng

Former Member
0 Kudos

Hi Valery,

i tried to implement and Upload Iview wich will be able to support multiple files

uploading. Could you send me your example with table.

thank you in advance

Former Member
0 Kudos

Hi Valery Silaev,

I have same requirement to show Fileupload element in the table and one upload button for the table.

I have to pass files with an RFC-Call to a R/3 System. Is there more information doing this?

Can i ask you for the sample project which you are dicussing in this thread.

Iam using NW04's SP9 portal. Iam using Webdynpro for this.

Thanks,

Helmut.

Former Member
0 Kudos

Helmut,

Ufortunately, I lost sources for this example. However there are nothing special: just create context structure as described in posts above and bind FileUpload control (cell editor).

VS

Former Member
0 Kudos

Oops -- found it in mail archives and replied to your e-mail.

However, sample does not contain any code for R/3 upload while such tasks highly depends on RFC used.

VS

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Valery Silaev,

I have same requirement to show Fileupload element in the table and one upload button for the table.

I have to pass files with an RFC-Call to a R/3 System. Is there more information doing this?

Can i ask you for the sample project which you are dicussing in this thread.

Iam using NW04's SP9 portal. Iam using Webdynpro for this.

Thanks,

Helmut.

Former Member
0 Kudos

Hi Valery Silaev,

I have same requirement to show Fileupload element in the table and one upload button for the table.

I need to store the documents in the KM CM repository.

It seems to be working but files are not uploading in to repository,single Fileupload button is uploading document into Repository.

Can i ask you for the sample project which you are dicussing in this thread.

Iam using NW04's SP7 portal. Iam using Webdynpro for this.

Thanks,

Damodhar.