BPM, Workflow, and Case

BPM, Workflow, and Case

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

 View Only
  • 1.  Create Table Dynamically

    Posted Sat September 30, 2023 02:57 PM

    Hello,

    I want to create a table which contains always one row and some columns. Colums count is related to a list variable length. For example, I want to make below table.

    DOCUMENTS

    CSV ICON            XLSX ICON          DOCX ICON        PNG ICON ......

    How can I achieve this? Please help me.



    ------------------------------
    YASEMİN ALADI
    ------------------------------


  • 2.  RE: Create Table Dynamically

    Posted Sun October 01, 2023 11:45 AM

    Hi,

    Use a horizontal layout and bind to the list variable. It will display the items in one row as you want.

    Laszlo



    ------------------------------
    Laszlo
    ------------------------------



  • 3.  RE: Create Table Dynamically

    Posted Sun October 01, 2023 02:11 PM

    Hello,

    When I use horizontal layout and bind list variable, the view seems like that.

    But, I want to see the view like this.

    DOC1   DOC2    DOC3    DOC4    DOC5



    ------------------------------
    YASEMİN ALADI
    ------------------------------



  • 4.  RE: Create Table Dynamically

    Posted Sun October 01, 2023 02:19 PM

    It is a table not a horizontal layout. Replace the table with a horizontal layout.



    ------------------------------
    Laszlo
    ------------------------------



  • 5.  RE: Create Table Dynamically

    Posted Mon October 02, 2023 12:54 PM

    I can offer two suggestions.

    The first is what Laszlo mentions.  If you bind a variable that is a list to a vertical layout, horizontal layout, panel, etc, then the view will repeat the content.  Here is an example of that setup.  I have strList which is a variable that is a list of strings, and a default value set to this variable:

    In my coach, I have a horizontal layout bound to the variable:

    I have a text field inside the horizontal layout bound to the "currentItem" of the list:

    At runtime, we'll get one column for each item in the list.  You can render each string with different renders if you like, such as Display text.

    The second technique is more involved but is useful if you want to dynamically populate a table.  In this example, we start with some data that we want to show in a table. I made up a business object to represent this data:

    As you can see above, I also created two variables to configure the table: one for the column specification - "cols", and the other for the table row data - "tableData".  Both are ANY lists with no default values.

    The layout for this coach has a Service data table and two Data views to access the variables.  The table is not bound to any data and no configuration is specified.  The Data views are bound to the corresponding variables above:

    We now dynamically set the column spec and add row data in the events of the table:

    Finally, let's look at how those two variables are populated:

    This is what you get at runtime with this approach.  Note that it would work with multiple rows as well:

    Hope this helps,

    Grant.



    ------------------------------
    Grant Taylor
    ------------------------------