on 12-18-2006 5:06 AM
Hi ,
i am unable to set values to a row dynamically .....
here is my code...
ArrayList al=new ArrayList();
for (int i = 0; i < node.size(); i++)
{
IRowsElement row = wdContext.nodeRows().createRowsElement();
row.setTest("in test"+i);
al.add(row);
}
wdContext.nodeRows().bind(al);
But in the o/p all the rows are sets with "in test 0" value ....
but i want values "in test 1 ", in test 2"......
plz help me.
Thanks,
Sunitha
Hi
Are you check the node.size() value.It will be 0.
otherwise assign i<10 or something.
Kind Regards
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try
for (int i = 0; i < node.size(); i++)
{
IRowsElement row = wdContext.nodeRows().createRowsElement();
row.setTest("in test"+i);
wdContext.nodeRows().addElement(row);
}
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
here is my code....
ArrayList al=new ArrayList();
for (int i = 0; i < wdContext.nodeI_Zmlst1_out().size(); i++)
{
IRowsElement row = wdContext.nodeRows().createRowsElement();
String s = wdContext.nodeI_Zmlst1_out().getElementAt(i).getAttributeAsText("Zdt_Comp");
int i1 ;
if(s.equals("Y"))
i1 = 0 ;
else if(s.equals("N"))
i1 = 1;
else
i1 = 2;
switch(i1)
{
case 0 : row.setSignal("S_S_LEDG.gif");
row.setTest("in green"+i);
wdComponentAPI.getMessageManager().reportSuccess(" green");
break;
case 1: row.setSignal("S_S_LEDR.gif");
row.setTest("in red"+i);
wdComponentAPI.getMessageManager().reportSuccess(" red");
break;
case 2: row.setSignal("S_S_LEDI.gif");
break;
}
wdContext.nodeRows().addElement(row);
}
here if the value is "Y" , i have set one image and if the value is "N" i have to set the other one.
but here it is always giving only one image, either "S_S_LEDG.gif " or "S_S_LEDR.gif".
Thanks,
Sunitha
Why you are using "i" instead of "i1" in switch statement ??
switch(i1)
{
case 0 : row.setSignal("S_S_LEDG.gif");
row.setTest("in green"+i1);
wdComponentAPI.getMessageManager().reportSuccess(" green");
break;
case 1: row.setSignal("S_S_LEDR.gif");
row.setTest("in red"+i1);
wdComponentAPI.getMessageManager().reportSuccess(" red");
break;
case 2: row.setSignal("S_S_LEDI.gif");
break;
}
Regards, ANilkumar
Message was edited by:
Anilkumar Vippagunta
Hi Sunitha,
The ouput dependes upon the value returned by the statement
wdContext.nodeI_Zmlst1_out().getElementAt(i).getAttributeAsText("Zdt_Comp");
I think its returning either "Y" or "N".Thats why it is displaying "S_S_LEDG.gif" or
"S_S_LEDR.gif".
Please check the values returned by the output node.
Regards, Anilkumar
In Ur previous post :
<i>Hi ,
here is my code....
ArrayList al=new ArrayList();
for (int i = 0; i < wdContext.nodeI_Zmlst1_out().size(); i++)
{
IRowsElement row = wdContext.nodeRows().createRowsElement();
String s = wdContext.nodeI_Zmlst1_out().getElementAt(i).getAttributeAsText("Zdt_Comp");
int i1 ;
if(s.equals("Y"))
i1 = 0 ;
else if(s.equals("N"))
i1 = 1;
else
i1 = 2;
switch(i1)
{
case 0 : row.setSignal("S_S_LEDG.gif");
row.setTest("in green"+i);
wdComponentAPI.getMessageManager().reportSuccess(" green");
break;
case 1: row.setSignal("S_S_LEDR.gif");
row.setTest("in red"+i);
wdComponentAPI.getMessageManager().reportSuccess(" red");
break;
case 2: row.setSignal("S_S_LEDI.gif");
break;
}
wdContext.nodeRows().addElement(row);
}
here if the value is "Y" , i have set one image and if the value is "N" i have to set the other one.
but here it is always giving only one image, either "S_S_LEDG.gif " or "S_S_LEDR.gif".
Thanks,
Sunitha
</i>
Do you want to say :
<i>
but here it is always giving only <b>"multiple"</b> image<b>s,which are</b> either "S_S_LEDG.gif " or "S_S_LEDR.gif".
</i>
Do you mean :
If you put
int i1 ;
if(s.equals("Y")) {
i1 = 0 ;
}
else if(s.equals("N")) {
i1 = 1;
}
else {
i1 = 2;
}
You get every row as green and if you put
int i1 ;
if(s.equals("N")) {
i1 = 0 ;
} else if(s.equals("Y")) {
i1 = 1;
} else {
i1 = 2;
}
All the images are red ?
Can you paranthesis to write your if else statements.
Please check the data also. May have a trace of data in the node.
Hi ,
String s = wdContext.nodeI_Zmlst1_out().getElementAt(i).getAttributeAsText("Zdt_Comp");
if the String value i am getting from back end for getElementAt(i), for i = 0 equal to "Y", then o/p is green image.
if the String value is "N" then o/p is red images.
My question is how will i set different images , to a row depending on the condition.
Hi Sunitha,
Can you try this:
for (int i = 0; i < wdContext.nodeI_Zmlst1_out().size(); i++)
{
IRowsElement row = wdContext.nodeRows().createRowsElement();
String s = wdContext.nodeI_Zmlst1_out().getElementAt(i).getAttributeAsText("Zdt_Comp");
int i1 ;
if(s.equals("Y")) {
row.setSignal("S_S_LEDG.gif");
row.setTest("in green"+i);
wdComponentAPI.getMessageManager().reportSuccess(s+" green");
} else if(s.equals("N"){
row.setSignal("S_S_LEDG.gif");
row.setTest("in green"+i);
wdComponentAPI.getMessageManager().reportSuccess(s+" red");
} else {
row.setSignal("S_S_LEDI.gif");
row.setTest("No Y or N "+i);
wdComponentAPI.getMessageManager().reportSuccess(" No Y or N");
}
wdContext.nodeRows().addElement(row);
}
Regards,
Ashwani
Hi ,
I solved the problem ,
The table in which i am adding this table , it's data source is bound to a model node.
i created another table binded it's datasource to the value node(Rows) i created it is working fine now.
but i want to dispaly the images row with the table which is bound to the modelnode.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.