• Mahesh Gollamudi
    December 21, 2017 at 10:27 am #4856

    BPM Version : 8.6

    I currently have a table control(BPM UI toolkit) bound to list of expenditureItem and I need to populate the sum total of each column on the table column header and was looking for any API methods that are exposed to reload the header when there is an onChange event on the cell.

    Even though I was able to achieve this using the unexposed proto methods , I was hoping this method be exposed on to the api so that the future upgrades of these controls wont cause any issue .Are there any alternative methods or approaches?

    1.Updating the cspecs with

    <tablecontrolId>._instance.cspecs[6].label = “Item Total:80”

    2.Reloading the table header

    <tablecontrolId>._proto._reloadHeader(<tablecontrolId>);

    Thanks & Regards,

    Mahesh Gollamudi

    SPARK Support
    December 21, 2017 at 3:44 pm #4857

    Hi Mahesh,

    You should be able to get the column specs from the context options, set the result to a variable, modify the needed property and set the value using

    table.context.options.columnSpecs.get(“value”) and table.context.options.columnSpecs.set(“value”, <variable>)

    The change handler should trigger the reload of the header automatically.

    Regards,

    Stephen P.

    Mahesh Gollamudi
    December 27, 2017 at 12:23 pm #4862

    Hi Stephen ,

    Thank you for your recommendation , have tried and I am getting the error .My understanding from your statement is that the default table change handler will reload the table(includes header) when there is an update on the header information .My guess from the error is ,the listener is failing to detect the change.

    var cSpecs = expenditure.context.options.columnSpecs.get(“value”);
    cSpecs.items[1].label = cSpecs.items[1].label +”:”+”BLAHBLAH”;
    expenditure.context.options.columnSpecs.set(“value”,cSpecs);

    //Result

    Error on change event [/]: TypeError: Unable to get property ‘binding’ of undefined or null reference

    Call stack: TypeError: Unable to get property ‘binding’ of undefined or null reference
    at _2f0.ui._isViewBound
    at constructor.prototype.change
    at _44d.callViewLifeCycleAPI
    at _f81.prototype._change
    at _f81.prototype._bindingChanged
    at Anonymous function

     

    Thanks & Regards

    Mahesh Gollamudi

     

    Mahesh Gollamudi
    December 27, 2017 at 12:27 pm #4863

    Is  there any way i can edit the post , i didn’t want the url info on this 🙂

     

    Thanks & Regards
    Mahesh Gollamudi

    SPARK Support
    December 27, 2017 at 1:01 pm #4864

    Hi Mahesh;

    You may need to create a list variable of type TableColumn and bind this to the Columns configuration option.

    Then initialize the variable with the desired specifications before attempting to use the .get and .set methods on the context option.

    Regards,

    Stephen P.

    Mahesh Gollamudi
    December 27, 2017 at 1:53 pm #4865

    Hi Stephen,

    I have tried that ,still no luck.Getting the same error .

    Thanks & Regards,

    Mahesh Gollamudi

    SPARK Support
    December 28, 2017 at 10:00 am #4892

    Hi Mahesh,

    The URLs have been removed from your post per your request.

    I have tested this code with BPM version 8.6:

    table = page.ui.get(“Table1”);
    cspecs = table.context.options.columnSpecs.get(“value”).items;
    cspecs[0].label = “Something Different”;
    table.context.options.columnSpecs.set(“value”,cspecs);

    The Table Columns configuration option must be bound to a variable list of type TableColumn with default values instantiated:

    var autoObject = [];
    autoObject[0] = {};
    autoObject[0].renderAs = “V”;
    autoObject[0].visibility = “V”;
    autoObject[0].sortable = false;
    autoObject[0].options = “”;
    autoObject[0].css = “”;
    autoObject[0].width = “”;
    autoObject[0].label = “Name”;
    autoObject[1] = {};
    autoObject[1].renderAs = “V”;
    autoObject[1].visibility = “V”;
    autoObject[1].sortable = false;
    autoObject[1].options = “”;
    autoObject[1].css = “”;
    autoObject[1].width = “”;
    autoObject[1].label = “Department”;
    autoObject

    Regards,

    Stephen P.

     

    Mahesh Gollamudi
    December 28, 2017 at 11:13 am #4893

    Thank you Stephen,

    //Not Working
    cols = expenditure.context.options.TableColumns.get(“value”);
    cols.items[1].label = cols.items[1].label +”:”+sum;

    //Working
    cols = expenditure.context.options.TableColumns.get(“value”).items;
    cols[1].label = cols[1].label+”:”+sum;

     

    the difference is the way am updating the label ,a JS object vs List ,thank you for your valuable feedback.

    Is there a place where we can find some documentation on the API.For some reason I couldn’t find these methods documented else where other than in the IE debugger window.

    Thanks & Regards

    Mahesh Gollamudi

    Mahesh Gollamudi
    December 28, 2017 at 11:49 am #4894

    I think it is more correct to say setting a list vs JS object made the difference.

    Thanks & Regards

    Mahesh Gollamudi

    SPARK Support
    December 28, 2017 at 12:10 pm #4895

    Hi Mahesh,

    table.context.options.columnSpecs.get(“value”).items simply returns the value of the configuration option defined in the Table coach view.  We have provided a internal method to handle any changes to this value.  Changes to Coach View context options is covered by IBM documentation here:

    https://www.ibm.com/support/knowledgecenter/SSFTN5_8.5.7/com.ibm.wbpm.wle.editor.doc/topics/rbindingdata.html

    Regards,

    Stephen P.

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

You must be logged in to reply to this topic.

Start typing and press Enter to search