• Gaurav Sharma
    May 11, 2018 at 2:40 am #5139

    Hello everyone. I’m using IBM BPM v8.6.
    In my coach, I’m using a pre populated and read only table and on selecting any row I wish to populate the data in the text fields(each attributes corresponding to that table). The data will be available for editing in the text fields . This functionality I’m able to achieve by using the Events : On row selected by user, where I’m using code like this

    ${Text1}.setData(row.data.ID);${Text2}.setData(row.data.Name);

    where Text1 and Text2 are the control ids of text fields. Now my requirement is that I can edit the data in those text fields and on click of a button lets say Save, I wish to reflect the changed data in the table as well.
    I’m using something like this in the Events : On Click of that button

    row.data.ID =${Text1}.getData(); row.data.Name =${Text2}.getData();

    but no luck in getting the data in the table. Any approach how this could be implemented?
    It seems like the problem with the table control

    SPARK Support
    May 14, 2018 at 9:32 am #5142

    Hi Gaurav,

    Perhaps this IBM knowledge base article will help.  See the sections on Accessing list elements and List operations:

    https://www.ibm.com/support/knowledgecenter/en/SSFPJS_8.6.0/com.ibm.wbpm.wle.editor.doc/topics/rbindingdata.html

    Regards,

    Stephen P.

    Gaurav Sharma
    May 15, 2018 at 3:45 am #5143

    Hi Stephen,

    Thanks for your earliest reply I’m posting twx of sample. What I am doing is “If a user selects a row the data should be updated in the attributes above table ” as shown in image ” on selection of row.jpg” This functionality I’m able to achieve using this code in the on change event of checkbox:

    //setting the data control for getting the index;
    ${../Data1}.setData(me.ui.getIndex());
    //setting the data in the textfields
    ${../Text1}.setData(${empName1=}.getData());
    ${../Text2}.setData(${empCode1=}.getData());
    ${../Text3}.setData(${phoneNo1=}.getData());
    ${../Text4}.setData(${country1=}.getData());

    Now I want to edit the data in those text fields and the value should be updated back in table dynamically once I click on save button, and I’m using the below code in the on click event of “save”

    var indexVar = ${Data1=}.getValue();
    console.log(“New Index is : ” +indexVar);

    ${empDetailsList1/empName[indexVar]}.setData(${Text1}.getData());
    ${empDetailsList1/empCode1[indexVar]}.setData(${Text2}.getData());
    ${empDetailsList1/phoneNo1[indexVar]}.setData(${Text3}.getData());
    ${empDetailsList1/country1[indexVar]}.setData(${Text4}.getData());

    However I’m not able to set the data in the table using this. The problem which I’m facing is that I’m not able to set the index of the table dynamically, though I can see the value of index in the console log. Also if I am putting any static value in the index like

    ${empDetailsList1/empName[0]}.setData(${Text1}.getData());

    the code works like a charm. So it seems the problem is with setting the index dynamically and not in how I’m addressing the controls.

     

    Please look into this issue and help me out on how can I achieve getting the table index dynamically.

     

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Start typing and press Enter to search