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

NWDS for java 7.1

Hey

Can someone help me i want to fill up a tablelist with object. I just created the table with variabels, but i dont know how to create different objects and fill them up in the table.

I tought i have to use the method CreateAndAddElement()

Regard Marlon

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jun 29, 2011 at 10:45 AM

    Dear Marlon,

    As per you requirment, you wanted to populate the context node for binding with table in view. Create the method and add the below code and call the method based on your requirement.

    Suppose you custom context node is XYZ and attribites are name and age.

    I<XYZ>Element ele = null; 
    try
    {
       // write code to check the size of the original RFC model node which you want to populate in custom node
         if(wdContext.node<>(RFC model node).size() > 0)
         {
                 for(int i=0; i<wdContext.node<>(RFC model node).size() ; i++)
                 {
                          ele = wdContext.create<XYZ>Element();
                          ele.setName(wdContext.node<RFC model node>().get<RFC model node>ElementAt(i).getName());
                          ele.setAge(wdContext.node<RFC model node>().get<RFC model node>ElementAt(i).getAge());
                          wdContext.node<XYZ>().addElement(ele);       
                  }
          }
    }catch(Exception ex)
    {    	
             wdComponentAPI.getMessageManager().reportException("An exception occured : "+ex.getLocalizedMessage(), true);
    }
    

    Hope it will helps

    Best Regards

    Arun Jaiswal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 29, 2011 at 11:08 AM

    hey arun,

    it dosent work i just want to create and object and add it to my table...

    are u sure that it is a code for 7.1?

    Many Greetings

    Marlon

    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.