cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between size and length of a node

Former Member
0 Kudos

Dear All ,

Can anybody please let meknow what is the difference between size and length of a node in webdynpro java

what is the code for finding a node that how many attributes it is holding in runtime

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

p330068
Active Contributor
0 Kudos

Dear Krishnakk

You can call the SIZE() method of the NODES and LENGTH() method on ATTRIBUTES.

Like if you have node Employee and Employee_ID and Employee_Name are attibute under it. suppose you have already populated the node employee.

***what is the code for finding a node that how many attributes it is holding in runtime

You have to identified the which node will be called based on the user actions;

You can fin the size of the node to identify number of the rows holding at runtime. loop through for to find the attributes


IWDMessageManager messageManager = wdComponentAPI.getMessageManager();
if(wdContext.nodeEmployee.size() > 0)
{        
         //Print Node size           
         messageManager.reportSuccess("Size of the Node ::"+wdContext.nodeEmployee.size() );
         for(int i=0; i<wdContext.nodeEmployee.size(); i++
          {
                 //Print Length of the Attributes Employee ID and Name
                 messageManager.reportSuccess("Length of the Employee Name ::"+wdContext.nodeEmployee().getEmployeeElementAt(i).getEmployee_ID().length());
               
                 messageManager.reportSuccess("Length of the Employee ID ::"+wdContext.nodeEmployee().getEmployeeElementAt(i).getEmployee_Name().length());
      
          }
}

Hope it will helps

Best Regards

Arun Jaiswal

Answers (2)

Answers (2)

Former Member
0 Kudos

The size of a context node is the number of elements stored in the node. I never heard the notion "length" of a context node. What do you mean with "how many attributes it is holding in runtime"?

Former Member
0 Kudos

Go through this help of node properties.

http://help.sap.com/javadocs/NW04S/SPS09/wd/com/sap/tc/webdynpro/progmodel/api/IWDNode.html

https://media.sdn.sap.com/html/submitted_docs/60_sp2_javadocs/webdynpro/com/sap/tc/webdynpro/progmod...

code for finding a node that how many attributes it is holding in runtime

int size = wdContext.nodeName().size();
for(int i=0;i<size;i++)
{
     //Display the node elements
     wdComponentAPI.getMessageManager.reportSuccess(wdContext.nodeName().getNodeElementAt(i).getAttName());
}

Regards,

Saleem Mohammad