cancel
Showing results for 
Search instead for 
Did you mean: 

how to set Dropdown list in tablen whith others Dropdown values in each row

Former Member
0 Kudos

how to set Dropdown list in tablen whith others Dropdown values in each row of the table

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi ,

You have to add the parent element before adding data to the child node ...you follow the below steps it will work

1) Take ContextStructure as follows ...

tabledata (valuenode)

ddownbyindex( value node) --within the tabledata node

value (attribute)

2)Binding to your layout

tabledata (node) ---bind this to the dataSource property of your table

ddownbyindex( node)

Value (attribute)--bind to the texts property of you DDbyIndex

3)In wdinit() method add the following code

IPrivate<Your view name>.ITabledataElement tabledataElement =wdContext.createTabledataElement();

wdContext.nodeTabledata().addElement(tabledataElement);

for(int i=0;i<5;i++)

{

IPrivate<Your viewname>.IDdownbyindexElement ddbyindexElement=wdContext.createDdownbyindexElement();

ddbyindexElement.setValue("Value"+i);

wdContext.nodeDdownbyindex().addElement(ddbyindexElement);

}

And set the cardinality property of the table node as 0..n

and dropdownbyinex node to 1..n

You try it ...

Regards

Madhavi

Edited by: madhavi kotra on Sep 2, 2008 6:00 PM

Answers (5)

Answers (5)

Former Member
0 Kudos

You mean you want to have different drop-down entries for each row? If yes, you have to use the *ByIndex variant.

Example:


Rows (node, cardinality=0:n)
-- Entries (node, cardinality=0:n, selection=0:1, singleton=false (IMPORTANT!), supply function = supplyEntries)
---- text (string)

Implement supply function like:


void supplyEntries(IEntriesNode node, IRowsElement parentElement)
{
  for (int i = 0; i < 3; ++i)
  {
    IEntriesElement e = node.createAndAddEntriesElement();
    e.setText("This is item #" + i + " for row #" + parentElement.index());
  }
}

Armin

Former Member
0 Kudos

hi

Follow the below steps

1) Take ContextStructure as follows ...

tabledata (node) ---bind this to the dataSource property of your ble

ddownbyindex( node) --child node of tabledata Node

Value (attribute)--bind to the texts property of you DDbyIndex

2)In wdinit() method add the following code

IPrivate<Your view name>.ITabledataElement tabledataElement =wdContext.createTabledataElement();

wdContext.nodeTabledata().addElement(tabledataElement);

for(int i=0;i<5;i++)

{

IPrivate<Your viewname>.IDdownbyindexElement ddbyindexElement=wdContext.createDdownbyindexElement();

ddbyindexElement.setValue("Value"+i);

wdContext.nodeDdownbyindex().addElement(ddbyindexElement);

}

And set the cardinality property of the table node as 0..n

and dropdownbyinex node to 1..n

You try it ...

Regards

Madhavi

Edited by: madhavi kotra on Sep 2, 2008 5:44 PM

Edited by: madhavi kotra on Sep 2, 2008 5:45 PM

Former Member
0 Kudos

Thank u

i did all steps but thereis exeption - "cannot bind or add elements because the node has no valid parent "

Former Member
0 Kudos

Hi,

hav a look at these docs:[http://searchsap.techtarget.com/tip/0,289483,sid21_gci1238730,00.html]

using simple type:

[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ded11778-0801-0010-258f-ac3b9408a194]

hpe it hlps u..

Regards

Khushboo

Former Member
0 Kudos

Hi,

Welcome to SDN.

You need to have an attribute for the dropdown and this attribute must be inside the same node with which your table's dataSource property is mapped. Set the type of this attribute with a simpletype which will have all the values that you want to show in the dropdown.

Hope it helps.

thanks & regards,

Manoj

Former Member
0 Kudos

Hi,

Use a supply function to populate child based on the parent selection.

Regards

Ayyapparaj