cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic ContextBinding

Former Member
0 Kudos

Hello,

I've got the following context structure:

NodeA.attributeA

NodeA.NodeB.attributeB

NodeB isn't a singleton.

I've created dynamically for each NodeA element one table. The table header is attributeA.

Now I want to create for each NodeB element one row in the corresponding table. That's the code:

int size = wdContext.nodeA().size();

for (int i = 0; i < size; i++) {

IWDTable table = (IWDTable)view.createElement (IWDTable.class, "table" + i);

table.bindDataSource(wdContext.nodeA().getAElementAt(i)getNodeInfo());

IWDTableColumn column = (IWDTableColumn) view.createElement(IWDTableColumn.class, "column" + i);

IWDTextView editor = (IWDTextView)view.createElement(IWDTextView.class, "editor" + i);

editor.bindText(wdContext.nodeA().getAElementAt(i).nodeB().getNodeInfo().getAttribute("attributeB"));

column.setTableCellEditor(editor);

}

The table will be created fine, but every table has the same content. Each table is filled with the NodeB elements of the first NodeA element.

So I get:

tableA1

nodeA1.nodeB1.attributeB

nodeA1.nodeB2.attributeB

tableA2

nodeA1.nodeB1.attributeB

nodeA1.nodeB2.attributeB and so on...

Is'nt it possible to bind a table to a specific contextNodeElement.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Sebastian,

When rendering, WD uses lead selection of NodeA to select corresponding NodeB. Then elements of selected NodeB are displayed by all tables.

What you need is either:

1. N (no. of elements) variants of NodeA with corresponding NodeB, i.e. structure like NodeA0.NodeB0, NodeA1.NodeB1, NodeA1.NodeB1... You may create such structure dynamically.

2. Use single IWDTable with TreeByNestingTableColumn to display hierarchical data.

3. If you are using NW04s you may create one table for NodeA, then create table pop-in and place second table for NodeB here. Second table (for NodeB) will be repeated for every row of first table (NodeA).

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Answers (3)

Answers (3)

Former Member
0 Kudos

I've created the context structure dynamically like Valery suggested. Now everything works fine. Thank you!

Former Member
0 Kudos

Thank you for fast reply.

Our customer wants to have the data in separate tables! So I have to try Valery's first suggestion.

Regards

Sebastian

Former Member
0 Kudos

Hi sebastian,

Seperate tables..!OK ! Why cant you create a dropdown whihc will display all the attributeA of firstnode.When user selects a value in the dropdown, the corresponding node element will be lead selected and the appropriate values of nodeB will be fetched..

Just a sugggestion.. Everything depends on your requirement.

Former Member
0 Kudos

Hi,

Are using SP11 + . You can opt for TreeByNestingColumn in this scenario,

YOu will be able to categorize as per your requirement.BUt it will be in a single able.My guess is you will find this solution better that the current one.

Please check Valery Silaev's Weblog in SDN for its usage.

Weblog Topic: Master of columns

Regards

Bharathwaj

Guess I was caught taking a nap.. ! Ooh ! seems like my post is already obsolete .