BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  How to use Badge in Service Data Table

    Posted Tue July 13, 2021 06:20 AM
    I am trying to use a badge in service data table but it is not rendering. Is there is any way to show it in the rows. Each row will have different color on the badge.(For ex- 'Low' in Blue, 'Medium' in 'Yellow' and High in Red).
    In the table control it is working fine but since I have update columns visibility on user actions therefore using service data table.

    ------------------------------
    Akash Gupta
    ------------------------------


  • 2.  RE: How to use Badge in Service Data Table

    Posted Wed July 14, 2021 01:18 PM
    Edited by Eric Ducos Wed July 14, 2021 04:49 PM
    It looks like IBM has enhanced Service Data Table to support creating view instances instead of just rendering Simple HTML or allowing custom cell rendering. Apparently, your Badge column *can't* have a corresponding Column definition in the Table's Configuration options, otherwise the table will try to display the column/cell as simple or custom HTML. But if you add a Badge as a column in the table then make sure not to have a corresponding column definition in the config options, then the Badge view will show up.

    If all else fails you can use custom cell rendering and add you badge HTML to the rendered cell/td. See the "Custom column rendering" under section 4.8 at this link.

    ------------------------------
    Eric Ducos
    ------------------------------



  • 3.  RE: How to use Badge in Service Data Table

    Posted Thu July 15, 2021 02:08 AM
    Thanks for the response.
    I am using the custom cell function to highlight. But was thinking that it might have some performance issues of the table. Because I have other columns as well on which I will be using the custom cell.

    ------------------------------
    Akash Gupta
    ------------------------------



  • 4.  RE: How to use Badge in Service Data Table

    Posted Thu July 15, 2021 08:06 AM
    The cost of custom cell rendering is what you make it :). The rendering cost of a table with all columns custom-rendered isn't significantly higher than Simple HTML rendering if your custom rendering logic does comparable things. It is typically much lower than rendering a column as an actual View.

    ------------------------------
    Eric Ducos
    ------------------------------



  • 5.  RE: How to use Badge in Service Data Table

    Posted Wed July 14, 2021 04:06 PM
    Edited by Rackley Boren Wed July 14, 2021 04:06 PM

    Eric is correct. To add a few thoughts, the documentation for the Service Data table does not go into detail on rendering types, but the Table control does (see here). The documentation mentions the default for the Table control at least is to render as Coach View. So either IBM is going for parity between the two controls or there is a bug. I am leaning towards a bug there given the documentation doesn't mention it as noted earlier. If it is going for parity, I would like to see the same render as options for the Service Data Table instead of just the two currently there (Simple HTML and Custom), so we can explicitly set Coach View as the render as option in cases like this.

    For Eric's suggestion of leaving out the Column definition in the Table's config options, the only way this works is if you have the badge as the last column in your table. If you were trying to have this as the first column, it wouldn't work. The Custom column rendering is the option I would probably go with here given what we are observing doesn't seem to be documented anywhere and you might run the risk of having to change your code if IBM changes the behavior.

    You mentioned the reason behind going with the Service Data Table was updating column visibility. If you are just showing/hiding, you can use the showColumns and hideColumns, which look like newer functionality added to both the Table and Service data table as I don't recall seeing these functions in the past. If you need to swap read-only / visible, you can use the getColumns and setColumns.



    ------------------------------
    Rackley Boren
    ------------------------------



  • 6.  RE: How to use Badge in Service Data Table

    Posted Thu July 15, 2021 02:06 AM
    Tried with the new functions showColumns/HideColumns. But seems like its only mentioned in the documentation. It throws error "TypeError: table1.hideColumns is not a function". I am using the BAW 20.0.0.1 version
    If I use set and get columns on the table component then I also get error. Even if i don't change anything just call getColumns and setColumns and the table content also disappears.

    Code- 
    var _this=this;
    this.myShow=function(){
    var table1= _this.ui.get('Table1');
    var colSPec=table1.getColumns();
    console.log("getColumns()--",colSPec);
    table1.setColumns(colSPec);
    table1.refresh(false);
    }

    Screenshot:-

     


    ------------------------------
    Akash Gupta
    ------------------------------



  • 7.  RE: How to use Badge in Service Data Table

    Posted Thu July 15, 2021 11:46 AM

    I checked a 20.0.0.1 VM and it seems that the new functions must have been released with 20.0.0.2. In regards to the error for the set and get columns, I am seeing that strange behavior as well. Data is cleared from the table and even when making a benign change like updating the column header value. In all the cases I looked at this occurred, and I see the errors regarding the bindingResolver as well. For the Service Data Table control, you can refresh and the data loads in fine, but for the Table control errors out. May be worth opening a PMR with IBM to get further support.



    ------------------------------
    Rackley Boren
    ------------------------------