cancel
Showing results for 
Search instead for 
Did you mean: 

drop down by index in table cell

Former Member
0 Kudos

Hello

I need for one column in table to have a drop down.

I have the the following context:

node: Zsi_Profile_TyperdvZish_Available_Timeslots_S_Rfc

subnode: X

value attribute in subnode X: a

Node X is singelton = false, selection: 0-1.

I am defined a drop down by index for one column and I want the data to come from node It_Rnpb2.

The code:

for (int i = 0; i< wdContext.nodeZsi_Profile_TyperdvZish_Available_Timeslots_S_Rfc().size();i++)

{

wdContext.nodeZsi_Profile_TyperdvZish_Available_Timeslots_S_Rfc().getElementAt(i);

for (int j = 0;j< wdThis.wdGetRendezVousCustomController().wdGetContext().nodeIt_Rnpb2().size();j++)

{

wdContext.nodeX().addElement(wdContext.createXElement());

wdContext.currentXElement().setA(wdThis.wdGetRendezVousCustomController().wdGetContext().nodeIt_Rnpb2().getIt_Rnpb2ElementAt(j).getOrgid());

}

}

The result is: for first table line a drop down with few empty lines and one of the line with the last value from It_Rnpb2, and for the other table lines drop downs just with an empty line.

How can I fix this?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Let me change those ugly node names into shorter ones and use an array containing the drop-down items for each row. I think you get the idea.

Table data source node: "Rows"

Non-singleton child node "Items", cardinality 0:N, with attribute "Text".

String TEXTS[][] with TEXT[r][j] = text of item j in row r


/* foreach row in table */
for (int r = 0; r < wdContext.nodeRows().size(); ++r)
{
  IRowsElement row = wdContext.nodeRows().getRowsElementAt(r);
  /* foreach drop-down list item */
  for (int j = 0; j < TEXTS[r].length; ++j)
  {
    /* create item */
    IItemsElement item = row.nodeItems().createItemsElement();
    row.nodeItems().addElement(item);
    /* set item text */
    item.setText(TEXTS[r][j]);
  }
}

I typed this code from memory so there might be minor errors.

Armin

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you Armin

Problem solved