Skip to Content
author's profile photo Former Member
Former Member

urgent******how can i get the number of rows enterd by the user in a table

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jan 09, 2008 at 12:44 PM

    Hi Rajesh,

    Check the size of the node to which the table is binded.

    Regards

    Sid

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 12:45 PM

    Hi,

    You can get the number of rows by the size of the node that you bind to the table.

    Kind Regards

    Saravanan K

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 01:02 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.