cancel
Showing results for 
Search instead for 
Did you mean: 

Repetitive entries in dropdown box of table....

Former Member
0 Kudos

Hi,

This is my code for the population of drop down box in table

groupDTOs[0] = { "g1","c1"}

groupDTOs[1] = { "g2","c1"} -- these are the values id....where g1 &g2 are groupids and c1 is categoryid..

Scenario 1:

If my code is like this ...

for(int i=0;i< groupDTOs.length;i++){

IPrivateAssignCateroryidforGrpid.IGroupNodeElement ele = wdContext.createGroupNodeElement();

wdContext.nodeGroupNode().addElement(ele);

ele.setGroupid(groupDTOs<i>.getGroupid());

ele.setCategoryid(groupDTOs<i>.getCategoryid());

for(int j=0;j<catid.length;j++ ){

IPrivateAssignCateroryidforGrpid.IGroupNodeElement ele1 = wdContext.createGroupNodeElement();

wdContext.nodeGroupNode().addElement(ele1);

ele1.setCategoryid(catid[j]);

}

}

This gives me the values in table as

Groupid Categoryid(ddbi Field)

first row in table g1 c1 (dropdownvalues)

c1 (dropdownvalues)

c1 (dropdownvalues)

XX (dropdownvalues)

xx (dropdownvalues)

XX (dropdownvalues)

....

2nd row in table null c1 (dropdownfields)

(n is total values in dropdown c1 (dropdownvalues)

i.e catid.length ) c1 (dropdownvalues)

XX (dropdownvalues)

xx (dropdownvalues)

XX (dropdownvalues)

....

nth row in table g2 c1 (dropdownfields)

(n is total values in dropdown c1 (dropdownvalues)

i.e catid.length ) c1 (dropdownvalues)

XX (dropdownvalues)

xx (dropdownvalues)

XX (dropdownvalues)

....

nth+1 null c1 (dropdownvalues)

c1 (dropdownvalues)

rest (dropdownvalues)

this repeat up to nth element of dropdownbox

suppose if dropdown has 5 elememts and groud id has 2 elements..then table will have 10rows

Scenario 2:

If I alter my code as this:

Code:

for(int i=0;i< groupDTOs.length;i++){

IPrivateAssignCateroryidforGrpid.IGroupNodeElement ele = wdContext.createGroupNodeElement();

wdContext.nodeGroupNode().addElement(ele);

ele.setGroupid(groupDTOs<i>.getGroupid());

ele.setCategoryid(groupDTOs<i>.getCategoryid());

}

for(int j=0;j<catid.length;j++ ){

IPrivateAssignCateroryidforGrpid.IGroupNodeElement ele1 = wdContext.createGroupNodeElement();

wdContext.nodeGroupNode().addElement(ele1);

ele1.setCategoryid(catid[j]);

}

This gives me output as follows:

Groupid Categoryid(ddbi Field)

first row in table g1 c1 (dropdownfields)

c1 (dropdownvalues)

c1 (dropdownvalues)

XX (dropdownvalues)

xx (dropdownvalues)

XX (dropdownvalues)

....

SecondRow in table g2 c1 (dropdownfields)

c1 (dropdownvalues)

c1 (dropdownvalues)

XX (dropdownvalues)

xx (dropdownvalues)

XX (dropdownvalues)

....

Rest of the table ( No groupid c1 (dropdownfields)

untill catid.length blank) c1 (dropdownvalues)

c1 (dropdownvalues)

XX (dropdownvalues)

xx (dropdownvalues)

XX (dropdownvalues)

....

c1 (dropdownfields)

c1 (dropdownvalues)

c1 (dropdownvalues)

XX (dropdownvalues)

xx (dropdownvalues)

XX (dropdownvalues)

....

suppose if dropdown has 5 elememts and groud id has 2 elements..then table will have 5 rows

Thanx in Advance..

Arjun.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

resolved

Former Member
0 Kudos

What do you want to achieve? Without knowing that it's difficult to judge if your code is correct.

Armin

Former Member
0 Kudos

Hi ,

I am populating the table with a dropdown box field in it...

I have given the code above

i got the issues as mentioned above..(ie)populating the values in table...

This is the table :(sorry for the poor allignment last time)

Case 1:

..............................Groupid........... Categoryid(ddbi Field)

first row in table ..........g1 .........................c1 (dropdownvalues)

...............................................................c1 (dropdownvalues)

...............................................................c1 (dropdownvalues)

...............................................................XX (dropdownvalues)

...............................................................yz (dropdownvalues)

...............................................................ab (dropdownvalues)

....

2nd row in table .........null .........................c1 (dropdownfields)

(n is total values .......................................c1 (dropdownvalues)

in dropdown ..............................................c1 (dropdownvalues)

i.e catid.length )........................................XX (dropdownvalues)

...............................................................ab (dropdownvalues)

...............................................................yz (dropdownvalues)

....

nth row in table ............g2 .........................c1 (dropdownfields)

(n is total values ................. ......................c1 (dropdownvalues)

in dropdown ..............................................c1 (dropdownvalues)

i.e catid.length ).........................................XX (dropdownvalues)

................................................................yz (dropdownvalues)

................................................................ab (dropdownvalues)

....

nth+1 .............................null .....................c1 (dropdownvalues)

..................................................................c1 (dropdownvalues)

...................................................................rest (dropdownvalues)

suppose if dropdown has 5 elememts and groud id has 2 elements..then table will have 10rows

Case 2

This is my output :

................................Groupid ...............................Categoryid(ddbi Field)

first row in table .............g1 ..........................................c1 (dropdownfields)

...................................................................................c1 (dropdownvalues)

...................................................................................c1 (dropdownvalues)

..................................................................................XX (dropdownvalues)

..................................................................................yz (dropdownvalues)

..................................................................................ab (dropdownvalues)

....

SecondRow in table .........g2 ........................................c1 (dropdownfields)

...................................................................................c1 (dropdownvalues)

....................................................................................c1 (dropdownvalues)

.....................................................................................XX (dropdownvalues)

...................................................................................yz(dropdownvalues)

.......................................................................................ab (dropdownvalues)

....

.....Rest of the table .................. ......................................c1 (dropdownfields)

( No groupid untill ............blank .......................................c1 (dropdownvalues)

catid.length.......................................................................c1 (dropdownvalues)

.......................................................................................XX (dropdownvalues)

......................................................................................yz (dropdownvalues)

......................................................................................ab (dropdownvalues)

suppose if dropdown has 5 elememts and groud id has 2 elements..then table will have 5 rows

This one is very much nearer to my requirement..

I populate this table by passing the "c1" as parameter...i need to remove the repetivitive values in dropdown box ie 'c1'

And I want the drop down boxes in table to be filled only for the records which has the group id..

hope u now understand my requirement...

Thank you..

Arjun.G.

Former Member
0 Kudos

Hi Arjun,

Can u send ur node structure & node properties?? Are u using cell variants for ur table??

regards

Sumit

Former Member
0 Kudos

The Node property and node structure is as follows

node:Groupnode:

Cardinality-0-n

selection-0-1..

GropNode

-categoryid

-groupid

-groupname

-status

-lastupdate

-updatedby

Thanx

Arjun.G

Former Member
0 Kudos

Hi Arjun,

For ur table datasource create 1 node & 1 child node inside that for dropdown values. For dropdown node, use supply function & assign values in the supply function . Then try.

regards

Sumit