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

Data overwriting n not getting displayed in seperate ro

Hi Experts,

I have a very simple doubt here.

I have two popups with me. Say popup1 and popup2. Both are tables.

popup2 opens through popup1. I have some data in popup2 which i have to pass to popup1. I select one row in popup2 and pass the same to popup1 on the click of button "ok". Now if I again select another row from popup2 and press the button "ok". the new value overwrites the old value in pupup1.

I need the new value from popup2 to be displayed in a new row in popup1 n no overwriting should happen.

In short, the data in popup1 coming from popup2 is not getting poplutaed in seperate rows, instead it is overwriting the previous entry.

Please suggest me complete code to iterate the data in different rows or else letme know if i have to make changes in some property of my tables in popup.

Best Regards,

Kaustubh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2009 at 04:01 AM

    Hi Kaustubh,

    Say the two table nodes are table1, table2

    I assume you have done the context mapping from popup1 to popup2 (table1 node). In "ok" event handler write this code and try

    IPrivate<viewname>.ITable1Element ele = wdContext.createTable1Element();
    ele.setAttrib1(wdContext.currentTable2Element().getAttrib1());
    ele.setAttrib2(wdContext.currentTable2Element().getAttrib2());   
    wdContext.nodeTable1().addElement(ele);

    Regards,

    Siva

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Kaustubh,

      I just gave sample code. You can set the as many number of attributes (fields in the table) as you required. The code adds every time one row to popup1 table.

      IPrivate<viewname>.ITable1Element ele = wdContext.createTable1Element();

      // add as many attributes as you want

      ele.setAttrib1(wdContext.currentTable2Element().getAttrib1());

      ele.setAttrib2(wdContext.currentTable2Element().getAttrib2());

      // finally add the new record to the Table1

      wdContext.nodeTable1().addElement(ele);

      Regards,

      Siva

  • Posted on Aug 26, 2009 at 04:52 AM

    Hi Kausthab,

    you want to get the details or rows selected in the popup2 to popup1 right?

    Get the current row from the popup2 and store it in another(say Node1) node while clicking ok.

    write another piece of code to get the size of the Node1. Once you got the size then loop that and create element for the popup1 table node.

    Simple.

    I think this is your problem

    Regards

    SM Nizamudeen

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2009 at 01:29 PM

    You will have to write some if loops to check if data is already present in the node which you are populating when passing data from popup2 to popup1. If the size of the node is greater than 0 you can then create a new element and add it to the node on click of the button in popup2.

    Thanks,

    GLM

    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.