on 01-09-2008 12:39 PM
Hi Frndz..
As per my requirement i need to do the validations for the multipple rows in a table that was enterd by the user,
T
The prob is how can i get that number of rows that enterd by user,
WDMessageManager msg = wdComponentAPI.getMessageManager();
String col1= "";
String col2= "";
double col3= 0;
double col4= 0;
double amount= 0;
int nodesize = wdContext.nodeTest().size();
try
{
for(int i=0; i<=2 ; i++)
{
col1 = wdContext.nodeTest().getTestElementAt(i).getCol1();
//msg.reportSuccess("col1 size is :"+col1);
col2 = wdContext.nodeTest().getTestElementAt(i).getCol2();
col3 = wdContext.nodeTest().getTestElementAt(i).getCol3();
col4 = wdContext.nodeTest().getTestElementAt(i).getCol4();
amount = wdContext.nodeTest().getTestElementAt(i).getAmount();
if(col1 == "" )
{
msg.reportException("Plz fil the col1 for line:",true);
break;
}
else
if(col2 == "" )
{
msg.reportException("Plz fil the col2 for line:",true);
break;
}
else
if(col3 <= 0)
{
msg.reportException("Plz fil the col3:",true);
break;
}
else
{
if(col4 <= 0)
{
msg.reportException("Plz fil the col4:",true);
break;
}
}
msg.reportSuccess("skvgjhdfgasdfgsjkafguisafisenvtvyeriy");
wdThis.test();
}
}
catch (Exception e)
{
msg.reportException("strMessage in catch block",true);
}
this is the code am going
Regards
Rajesh
Hi,
You can try this:
/**
* Let's say the table's datasource is a node called Table and it has two attributes first & second.
* You want to check if any of these attributes has been changed by the user or not. If they have been
* changed then you want to do some validations against them.
*/
int sizeOfTable = wdContext.nodeTable().size();
for(int i = 0; i < sizeOfTable; i++){
IPrivate<view name>.ITableElement ele = wdContext.nodeTable().getTableElementAt(i);
if(ele.isChangedByClient(ITableElement.<attribute name>)){
//value has been changed, do some validation. You can get the row index using ele.index().
}
}
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can get the number of rows by the size of the node that you bind to the table.
Kind Regards
Saravanan K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
Check the size of the node to which the table is binded.
Regards
Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
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.