on 01-23-2008 5:46 AM
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.
resolved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What do you want to achieve? Without knowing that it's difficult to judge if your code is correct.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Hi Arjun,
Can u send ur node structure & node properties?? Are u using cell variants for ur table??
regards
Sumit
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 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.