Skip to Content
avatar image
Former Member

How to display rows from index 1 to all in a table

Hi,

I am facing a problem please help me.

I created a node in context with cardinality 1..n so that there will always be a element present for that node.

From one view i am providing data to this node and adding new blank element to this node.

I binded a table from view to this node so that it is displaying all the rows with a blank row at the start.

Now i want to display all the elements of that node except that blank first element in to a table

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 20, 2008 at 08:02 AM

    hi!

    to display all the rows set the property visible rowcount and you can invalidate that elemnt to remove first blank row .

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 20, 2008 at 08:46 AM

    Hi,

    While adding elements to the Node start the loop with 1 not from 0.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 09:00 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 08:04 AM

    Hi Amol,

    You can invalidate the node before and then add the elements from the second table or you can remove the blank element from the node.

    you can use the following code to remove an element

    int listSize = wdContext.node<Node Name>().size();
    		
    if(listSize > 0) 
    {
    for(int i = listSize - 1; i >= 0; --i)
    {
    wdContext.node<Node Name>().removeElement(wdContext.node<Node Name>().getElementAt(i));
    }
    }
    
    

    or use the following code to invalidate the node.

     wdContext.node<Node Name>().invalidate();
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 08:04 AM

    Hi,

    There are many ways to do this, one simple way is just create another node(dummy) with same attributes and just copy the elements from original node (from row index 1). Finally bind the dummy node to the table.

    For example say if (ABC) is your original node then create another copynode(DEF) with same attributes and copy the elements from ABC to DEF using the following code

    for(int i=1;i<wdContext.nodeABC().size();i++)

    {

    IPrivate<<viewname>>.DEFelement ele = wdContext.createDEFelement();

    ele.set<<Attribute>>(wdContext.nodeABC().getABCElementAt(i).get<<Attributename>>);

    wdContext.nodeDEF().addElement(ele);

    }

    Hope this will solve your problem. Revert me if you need any clarifications

    Regards

    Raghu

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 08:23 AM

    Hi,

    just change the cardinality of the node to "0...n " which is bind to the table where you want no blank space.

    Regards,

    ramesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 11:16 AM

    I want to have a empty element in the node so that the form with UI elements bound to this node can fill the inputs and the same node was connected to the table which shows that blank row in the table so to avoid that blank row in table, OnPlug event of that view containing that table i deleted that element with wdContext.nodeEmployee().removeElementAt(0); and after coming out of this view in the OnAction method added the same blank element.

    Add comment
    10|10000 characters needed characters exceeded