cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByIndex in a Table

Former Member
0 Kudos

Hi,

I have a table in which few columns are DropDownByIndex UI elements. The data for the drop down list is coming from R/3.

When I select a value from the drop down for a particular row of the table, all the remaining rows of the table get populated with the value I selected from the drop down.

Can some one tell me how to avoid this, and assign the selected value to that particular row only?

Thanks in advance.

Regards,

Reena

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Reena,

For having an independent DropDownByIndex inside a table, we need to have a non-singleton childnode inside the node bound to the table. And the 'texts' property of the DropDownByIndex should be bound to an attribute inside the child node.

I have noticed only singleton nodes for RFC data (I don't know whether this is always the case

So, inside the tablenode, we need to create a non-singleton valuenode. This will create seperate instances of this valuenode for each row of the table and therefore we can have independent dropdowns. But we need to populate this node for each table element either using the supplyfunction or explicitly creating and populating the elements for each parent element.

This similar query may help you

Hope this helps,

Best Regards,

Nibu.

Former Member
0 Kudos

Hi Nibu,

I created a model node under my node which is bound to the table. I bound this model node to my Bapi model and got the following structure.

< Table node > singleton = true

-- <Drop down node > singleton = true

-- <Output node > singleton = true

-- < Li node > singleton = false (set this to false manually )

-- <attribute bound to the drop down >

But I am getting the following error:

SarniaAllocationComp.Zl_Wfetch_Sarnia_Allocations_Input.Output.Li_Allocations.Shipper_DropDown): cannot bind or add elements because the node has no valid parent

And I dont think I can use a Value node since the data for my dropdown has to come from the BAPI.

Can you help?

Thanks and Regards,

Reena

Message was edited by: Reena Prabhakar

Former Member
0 Kudos

Hi Reena,

Say for eg: your node model structure is as below:

< Table node > singleton

-- <Drop down node > singleton

So, you have bound your table to the node < Table node > and it displays some values directly under that node. And let the values to be displayed in the dropdown be inside the node <Drop down node > (Let that node be anywhere, needn't be directly inside the tablenode).

1) Click on the <Drop down node > and find the structure details for the same. (Under the properties tab, under 'Model' heading, you can find the structure path of the node).

2) Create a value node under <table node> with the structure binding (Make sure you select the checkbox 'create with structure binding' ). Now choose the structure for <Drop down node> (from step 1)

3) Make the singleton property of the <Drop down node> as false;

4) Create a necolumn for the table, create 'DropDownByIndex' as the cell editor and bind the 'texts' property to the required attribute inside the new Value node.

5) After executing the RFC, write the following lines of code:

for(int i=0;i<wdContext.node<table node>().size();i++)

WDCopyService.copyElements(wdContext.node<Drop down node>(),wdContext.node<table node>().get<tabel node>ElementAt(i).node<value node name>());

This will give you independent dropdowns for each row of the table.

Hope this helps,

Best Regards,

Nibu.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Reena.

I assume that the drop down is mapped to the function's output.

The way that i use to avoid that is creating a vlaue node with a value attribute and create the list as the code below:

IWDAttributeInfo attributeInfo = wdContext.node<NODE>().getNodeInfo().getAttribute("<ATT NAME>");

ISimpleTypeModifiable simpleType = attributeInfo.getModifiableSimpleType();

IModifiableSimpleValueSet valueSet =

simpleType.getSVServices().getModifiableSimpleValueSet();

valueSet.keySet().removeAll(valueSet.keySet());

for(int j=0; j<size<FUNCTION RESULT>; j++){

//<GET THE VALUES OF THE FUNCTION RESULT>

valueSet.put(<KEY>,<VALUE>);

}

With this code the selection is only for one row.

Best regards

Gregory.

Former Member
0 Kudos

Hi Gregory,

Can you kindly elaborate on the <KEY>,<VALUE> ? What exactly should be passed here?

Thanks and Regards,

Reena

Former Member
0 Kudos

Did u try with the singleton propertie of the node as recomends the other people? I've never proved that.

If so and doesnt works. Firts <KEY> <VALUE> works for drop down by key (sorry about that) and means that the VALUE is the text that the users see when the list is opened and this value is identified by the KEY that the users dont see.

Regards.

Gregory.

Former Member
0 Kudos

Hi,

A lot depends on how the data is available in the model node.

1. Is there a seperate node available for storing the values of the dropdown alone ?

2. Are you mapping all the dropdown 's to a single attribute.. or to elements of node.

3. Do all the dropdown's have the same data.

4. Is the number of values is dropdown more than 5 -10 ?

If its less..create a valueset...(simpletype).

To create it,you can follow Gregory.. Key and Value - both the values to be displayed in the dropdown !

Regards

Bharathwaj

Former Member
0 Kudos

hi,

Bind the table witha context node for ex:

node

value1

value2

value3node

value1

value2

value3

bind this context node to table dynamically

delete the cell editor from table column and add dropdown byIndex

ashish_shah
Contributor
0 Kudos

Hi Bharathwaj,

I have a similar scenario as explained by you.

There is a seperate thread for this :

For my case:

1. Is there a seperate node available for storing the values of the dropdown alone ?

-> I have data in value node, and i want to store it in other value node's attribute.

2. Are you mapping all the dropdown 's to a single attribute.. or to elements of node.

->i am mapping all the dropdown's to a single attribute of a table.

3. Do all the dropdown's have the same data.

-> all the drop down have same data type. ( Not sure about the same data though).

4. Is the number of values is dropdown more than 5 -10 ?

-> yes it is around 20 to 30.

If its less..create a valueset...(simpletype).

Can you suggest a solution to this.

Thanks.

Ashish

former_member182372
Active Contributor
0 Kudos

Hi Reena,

make "singleton" property of node which contains data for dropDown to "false".

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi,

Create an value attribute inside the node and assign it to a simpletype which contains teh value for drop down.

Now map this attribute to the dropdown.

Now each row will have a seperate attribute instance to store its values.So your problem will not arise.

Oops ! For this you have to use DropDownByKey

Regards

Bharathwaj

Former Member
0 Kudos

Hi Bharathwaj,

I cannot use a DropDownByKey since the data for the drop down list is coming from a BAPI.

Any other solutions?

Thanks and Regards,

Reena

Former Member
0 Kudos

If you have a model node, you can add a "helper" value node first (cardinality 1:1, selection 1:1, singleton=false) and inside that you can add the value node (cardinality 0:n, selection 0:1 or 1:1, singleton=false) providing the dropdown list items.

Armin