Skip to Content
author's profile photo Former Member
Former Member

DropDownByIndex in a Table

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 09, 2006 at 01:25 PM

    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

    table-columns-as-dropdown-by-index

    Hope this helps,

    Best Regards,

    Nibu.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

  • Posted on Feb 09, 2006 at 01:42 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Bharathwaj,

      I have a similar scenario as explained by you.

      There is a seperate thread for this :

      Bind data to Dropdownlist in table field

      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

  • author's profile photo Former Member
    Former Member
    Posted on Feb 09, 2006 at 01:18 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • Posted on Feb 09, 2006 at 01:29 PM

    Hi Reena,

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

    Best regards, Maksim Rashchynski.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.