on 02-09-2006 1:12 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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
Hi Reena,
make "singleton" property of node which contains data for dropDown to "false".
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.