Skip to main content
September 26, 2024
Question

User Interface

  • September 26, 2024
  • 12 replies
  • 0 views

Hi Everyone, I need to Implement one grid Structure that would be like 

the grid would be dynamic grid, the request Ids may depend on cif number, For Example (CIf-117907 have 5 requests (123456,12456,13456,134566,1244555) like that.

How Would I do that if someone can provide solution that would be more helpful, If more details required please let me know  

Thanks.

    12 replies

    somasundaram.d
    September 26, 2024

    Can you please elaborate more

    September 26, 2024

    ok, I need to implement one grid with all request Ids related to the cif. One cif may have one one request,other cif may have multiple request. The grid structure as shown above and dynamic grid. examples( cif-112233 may have 123456,786535 requests and other cif may have cif-345678 ,requests(432167,654328,876543,7655433) like so on

    September 26, 2024



    a!localVariables(
      local!approvedCAs: rule!CR_QE_getApprovedCAsByFilters(
        cif_int: ri!cif_int,
        requestId_int: ri!requestId_int
      ),
      local!selectedButton: joinarray(
        {
          index(
            ri!crModuleStatus_cdt,
            "requestId_int",
            {}
          ) & if(
            or(
              rule!APN_isBlank(
                index(
                  ri!crModuleStatus_cdt,
                  "versionNo_int",
                  {}
                )
              ),
              rule!APN_isZero(
                index(
                  ri!crModuleStatus_cdt,
                  "versionNo_int",
                  {}
                )
              )
            ),
            "",
            "." & index(
              ri!crModuleStatus_cdt,
              "versionNo_int",
              {}
            )
          ),
          index(
            ri!crModuleStatus_cdt,
            "actionType_txt",
            {}
          ),
          index(
            ri!crModuleStatus_cdt,
            "approvedOn_dt",
            {}
          )
        },
        " - "
      ),
      {
        rule!CR_APP_RT_displayApproverInfoNote(
          message_txt: "Select workflow to see the Request data"
        ),
        a!sideBySideLayout(
          items: {
            a!sideBySideItem(
              item: a!buttonArrayLayout(
                buttons: {
                  a!forEach(
                    items: joinarray(
                      {
                        index(
                          ri!crModuleStatus_cdt,
                          "requestId_int",
                          
                          {}
                        ) & if(
                          or(
                            rule!APN_isBlank(
                              index(
                                ri!crModuleStatus_cdt,
                                "versionNo_int",
                                {}
                              )
                            ),
                            rule!APN_isZero(
                              index(
                                ri!crModuleStatus_cdt,
                                "versionNo_int",
                                {}
                              )
                            )
                          ),
                          "",
                          "." & index(
                            ri!crModuleStatus_cdt,
                            "versionNo_int",
                            {}
                          ),
                          
                        ),
                        index(
                          ri!crModuleStatus_cdt,
                          "actionType_txt",
                          {}
                        ),
                        index(
                          ri!crModuleStatus_cdt,
                          "approvedOn_dt",
                          {}
                        )
                      },
                      " - "
                    ),
                    expression: {
                      a!buttonWidget(
                        label: fv!item,
                        value: fv!item,
                        saveInto: local!selectedButton,
                        size: if(
                          local!selectedButton = fv!item,
                          "STANDARD",
                          "SMALL"
                        ),
                        style: if(
                          local!selectedButton = fv!item,
                          "PRIMARY",
                          "LINK"
                        )
                      )
                    }
                  )
                },
                align: "START",
                showWhen: ri!workFlow_bool
              )
            ),
            a!sideBySideItem(
              item: a!buttonArrayLayout(
                buttons: {
                  a!buttonWidget(
                    label: "Completed Requests",
                    style: "PRIMARY"
                  )
                },
                align: "START",
                
              )
            ),
            
          }
        )
      }
    )

    And the result I am getting as this But Result should be in seperate button /action ,How would I achieve this?

    mikes0011
    Brainy
    September 26, 2024

    I usually implement such things with multiple entries listed in one column cell - one example is what Shubham provided already, though often I simply display each entry on its own line (and if there can potentially be many many entries, i'll only show the first few unless the user clicks an internal dynamic link to expand the selection).

    September 27, 2024

    As suggested by Mike, you can display a list:

    a!localVariables(
      local!data: {
        a!map(cif: 1, requestId: { 1000, 1001, 1002 }),
        a!map(cif: 2, requestId: { 2000 })
      },
      a!gridField(
        label: "Read-only Grid",
        labelPosition: "ABOVE",
        data: local!data,
        columns: {
          a!gridColumn(label: "CIF", value: fv!row.cif),
          a!gridColumn(
            label: "CIF",
            value: a!richTextDisplayField(
              value: a!richTextBulletedList(items: fv!row.requestId)
            )
          )
        }
      )
    )

    September 27, 2024

    a!localVariables(
      local!selectedButton,
      local!moduleStatus: a!map(
        request: rule!CR_QE_getApprovedCAsByFilters(
          requestId_int: ri!requestId_int,
          cif_int: ri!cif_int,
          status_txt: "APPROVED"
        )
      ),
      {
        a!buttonArrayLayout(
          buttons: a!forEach(
            items: local!moduleStatus.request,
            expression: a!buttonWidget(
              label: joinarray(
                {
                  fv!item.requestId_int & fv!item.actionType_txt & fv!item.approvedOn_dt
                },
                " - "
              ),
              value: joinarray(
                {
                  fv!item.requestId_int & fv!item.actionType_txt & fv!item.approvedOn_dt
                },
                " - "
              ),
              saveInto: local!selectedButton
            )
          ),
          marginAbove: "MORE"
        ),
        a!gridLayout(
          headerCells: {
            a!gridLayoutHeaderCell(label: "DropDown")
          },
          columnConfigs: a!gridLayoutColumnConfig(width: "NARROW"),
          rows: a!gridRowLayout(
            contents: a!dropdownField(
              label: "",
              placeholder: "Please Select Values",
              choiceLabels: cons!CR_APP_REQUEST_SECTION_NAMES,
              choiceValues: cons!CR_APP_REQUEST_SECTION_NAMES,
              value: "",
              saveInto: ""
            )
          )
        )
      }
    )
     

    Hi Thanks for your help and On top of that code trying to achieve dropdown on selecting each request,let me know your input on this please.