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

getting multiple row data of the table at a time

hi

i have a table where multi selection is possible

now when i multiselect two rows of the

of the table , where there may be 100 row in the

table , i may select that is multi select two rows

i need to get the data of the corresponding rows .

put it in String or any other and set the data to

a structure

can any one help me how can i catch the multiple rows in

a table at a time .

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jun 04, 2008 at 06:49 AM

    hi Kishore,

    i have implemented this, in that case i have to select multiple row frm table and delete them...for that on toggle of checkbox i have written this code where i m capturing the data for the row in the context and on the action of delete i m deleting data:-

    i have decleare global variable like;-

    int selectedtableindexes[] = new int[50];

    int selectedcount = 0;

    array accoring to my need:-

    String SequenceNoIndexes[] = new String[50];

    String ProjIDIndexes[] = new String[50];

    String ModuleTypeIndexes[] = new String[50];

    function code on the action of toggle:-

    public void onActiongetSelectedRow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

    {

    //@@begin onActiongetSelectedRow(ServerEvent)

    int countselected = wdContext.nodeTable().getLeadSelection();

    int temp = countselected + 1;

    flag = true;

    for (int i = 0; i <= selectedcount; i++) {

    if (selectedtableindexes<i> == temp) {

    selectedtableindexes<i> = 0;

    flag = false;

    }

    }

    if (flag) {

    selectedtableindexes[selectedcount++] = ++countselected;

    deleteCount = deleteCount + 1;

    }else{

    deleteCount = deleteCount - 1;

    }

    for (int j = 0; j < selectedcount; j++) {

    if (selectedtableindexes[j] != 0) {

    SequenceNoIndexes[j] =

    wdContext

    .nodeTable()

    .getTableElementAt(

    (selectedtableindexes[j]) - 1)

    .getSequenceNo();

    ProjIDIndexes[j] =

    wdContext

    .nodeTable()

    .getTableElementAt(

    (selectedtableindexes[j]) - 1)

    .getProject_Id();

    ModuleTypeIndexes[j] =

    wdContext

    .nodeTable()

    .getTableElementAt(

    (selectedtableindexes[j]) - 1)

    .getModule_Type();

    }

    }

    //@@end

    }

    after that imlementaed delete function like that:-

    public void onActionDelete(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

    {

    //@@begin onActionDelete(ServerEvent)

    wdContext.nodeVnDeleteNode().invalidate();

    IPrivateAuthorizationView.IVnDeleteNodeElement deleteNodeElement;

    try {

    if(deleteCount!=0){

    for(int index=0;index<SequenceNoIndexes.length;index++){

    deleteNodeElement = wdContext.nodeVnDeleteNode().createVnDeleteNodeElement();

    deleteNodeElement.setVaModule_Type(ModuleTypeIndexes[index]);

    deleteNodeElement.setVaProj_Id(ProjIDIndexes[index]);

    deleteNodeElement.setVaSequenceNo(SequenceNoIndexes[index]);

    wdContext.nodeVnDeleteNode().addElement(deleteNodeElement);

    }

    wdThis.wdGetAuthorizationController().doProcess(2);

    wdComponentAPI.getMessageManager().reportSuccess("Records deleted successfully.");

    }else{

    wdComponentAPI.getMessageManager().reportException("Please select atleast one item.",true);

    }

    } catch (Exception e) {

    wdComponentAPI.getMessageManager().reportException("Unalbe to delete the Record. Please contact administrator.",true);

    }

    wdThis.getRecords();

    selectedcount = 0;

    RejectedCount = 0;

    deleteCount = 0;

    flag = true;

    for (int i = 0; i < 50; i++)

    selectedtableindexes<i> = 0;

    selectFlag = 0;

    //@@end

    }

    Hope that may be help you......

    Regards,

    Deepak

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 04, 2008 at 08:06 AM

    hi

    thanks for the response

    conditions are ok as

    for(int i=0;i<n;i++) n is the size of the node

    {

    if(wdcontext.nodeTable1.ismultiselect(i))

    {

    now iam getting the row values in string as

    String name =wdcontext.nodetablename.currentcontextelemt.getname();

    now this is ok for the first row .

    now i need also the second row in to the string or array

    as i need to set this row values which i have get

    into a structure. which has elements same as table elements.

    so what is the procedure as to capture , as i have put

    table property Selection Mode to Multi

    rows data .

    }

    i am able to get the single row data for single selection .

    any suggestions .

    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.