cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the childNode of a selectedElement

Former Member
0 Kudos

The context structure is as followes:

Context

-- Item

-


ItemFiles

-


subItem

-


subItemFiles

Users can upload files to the item (which there is always 1) and users can upload files per subitem (which are 1..n). To do this i use a generic upload popup view which contains a table which should contain the files that are uploaded. Subitems are displayed in a table.

When people upload files to a subItem the files are displayed in the table. When i close the popup and DONT change the selection of the subItem in the table and reopen the upload popup view the table in the upload view contains the files that were just uploaded.

When i change the selection of the subItem, upload some files and then change back to the original subItem to upload some more files, the table is empty. It should contain the files that were previously uploaded.

I have been thinking something along these lines:

When a user want the upload files to a subItem, i need to get the selected subItem. This is done with: wdContext.nodeItem().nodeSubItem().getSubItemFilesElementAt(wdContext.nodeItem().nodeSubItem().getLeadSelection());

Of this node element i need to get the subnode (the SubItemFiles node) that contains the files. I have no idea how to do this....

It is this node i need to bind to the table as the DataSource, i guess....

Message was edited by:

Martijn Koevoets

Message was edited by:

Martijn Koevoets

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1.What is your table's data source as of now? is it the Item node or SubItem node?

I think you have to bind table to node Subitems if you want to see the Subitems files.

2. You can access the SubItem context value directly using

wdContext.nodeSubItems().getCurrentElement() - this just a psuedo code.

3. In the code are you writing something like add/bind the values to the node element?

-np

Former Member
0 Kudos

It is a dynamicly generated table that has the ItemNode or the SubItemNode as datasource depending on what is selected.

I was not possible to do wdContext.nodeSubItems.getCurrentElement as you described. The reason for this was that is that the SubItem node was a singleton.... Naturally this should not be the case! I overlooked that one!

Thanks!

Former Member
0 Kudos

This post can be deleted now...

Message was edited by:

Martijn Koevoets

Message was edited by:

Martijn Koevoets

Answers (1)

Answers (1)

Former Member
0 Kudos

just selct that particulat element..Right click of it..select insert child..it shows the menus...just select which one u want.that's it

Former Member
0 Kudos

I am talking about JAVA Implementation of this problem... i am not sure what you are talking about...