Skip to main content
October 21, 2024
Question

RE: Dynamic Link

  • October 21, 2024
  • 15 replies
  • 0 views

Hi ,

I am trying to implement: On Click of Dynamic Link displaying one Grid, But AS per the requirement This needs to be displayed as side By side,

As of Now On click of Link the grid is displaying but How would I make side By side grid, Since grid has box Layout and Grid Field ,Ui is throwing error .

How would I make change in this code -On click of link grid has to be displayed.

a!localVariables(
  local!priority: false(),
  {
    a!linkField(
      /*label: "Link Field",*/
      links: {
        a!dynamicLink(
          label: "Audit History",
          value: local!priority,
          saveInto: a!save(local!priority, true())
        )
      }
    ),
    a!sectionLayout(
      contents: {
        rule!CR_APP_SC_auditDetails(
          cif_int: ri!cif_int,
          sectionName_txt: cons!CR_APP_TXT_AUDIT_SECTION_NAMES[1]
        )
      },
      showWhen: local!priority
    )
  }
)
 

    15 replies

    stefanhelzle0001
    October 21, 2024

    Use the showWhen parameter in the section layout.

    October 21, 2024

    Hi Stefan , I have used showWhen ,Sorry Let me know if anything I have missed.

    a!localVariables(
      local!priority: false(),
      {
        a!linkField(
          /*label: "Link Field",*/
          links: {
            a!dynamicLink(
              label: "Audit History",
              value: local!priority,
              saveInto: a!save(local!priority, true())
            )
          }
        ),
        a!sideBySideLayout(
          items: a!sideBySideItem(
            item: rule!CR_APP_SC_auditDetails(
              cif_int: ri!cif_int,
              sectionName_txt: cons!CR_APP_TXT_AUDIT_SECTION_NAMES[1]
            )
          ),
          showWhen: local!priority
        )
      }
    )

    If I use sideByside Item, getting this error -Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!sideBySideLayout [line 14]: A side by side layout has an invalid item. The item at index 1 contains a component that is not supported in a side by side layout. Received: BoxLayout.

    stefanhelzle0001
    October 21, 2024

    OK. Well ... did you consider to use a columns layout instead of that side-by-side?

    prasantap0900
    October 22, 2024

    You can use two columns, keep the showWhen and adjust the width of the column. Maybe it will be helpful.

    October 22, 2024

    No User doesn't want that ,

    By Any chance can we convert this code to side By Side items?

    a!boxLayout(
              label: cons!CR_APP_LAB_AUDIT_DETAILS[1],
              isCollapsible: true(),
              isInitiallyCollapsed: true(),
              marginBelow: "STANDARD",
              contents: {
                a!gridField(
                  spacing: "DENSE",
                  height: "AUTO",
                  shadeAlternateRows: true(),
                  data: local!data,
                  pageSize: 10,
                  initialSorts: a!sortInfo(field: "createdOn_dt", ascending: false()),
                  columns: {
                    a!gridColumn(
                      /*label: cons!CR_APP_LAB_AUDIT_DETAILS[3],*/
                      value: rule!CR_APP_RT_displayAuditStatusIcon(rowStatus_txt: fv!row.rowStatus_txt),
                      width: "ICON",
                      align: "START"
                    ),
                    a!gridColumn(
                      label: cons!CR_APP_LAB_AUDIT_DETAILS[2],
                      value: rule!CR_APP_DSC_mapAuditSectionNames(
                        sectionName_txt: index(fv!row, "sourceName_txt", tostring(null))
                      ),
                      width: "AUTO",
                      align: "START"
                    ),
                    a!gridColumn(
                      label: cons!CR_APP_LAB_AUDIT_DETAILS[4],
                      value: rule!CR_FN_nbfDateTimeFormat(input: fv!row.createdOn_dt),
                      width: "AUTO",
                      align: "START"
                    ),
                    a!gridColumn(
                      label: cons!CR_APP_LAB_AUDIT_DETAILS[5],
                      value: rule!APN_FN_getDisplayName(
                        userId: index(fv!row, "createdBy_txt", tostring(null))
                      ),
                      width: "AUTO",
                      align: "START"
                    ),
                    a!gridColumn(
                      label: cons!CR_APP_LAB_AUDIT_DETAILS[6],
                      value: if(
                        rule!APN_isBlank(fv!row.createdBy_txt),
                        tostring(null),
                        if(
                          isusernametaken(fv!row.createdBy_txt, ),
                          if(
                            user(fv!row.createdBy_txt, "status"),
                            if(
                              not(isnull(fv!row.updatedByRole_txt)),
                              fv!row.updatedByRole_txt,
                              rule!CR_FN_getUserRole(inputUser_txt: fv!row.createdBy_txt)
                            ),
                            tostring(null) & "User deactivated"
                          ),
                          tostring(null)
                        )
                      ),
                      width: "AUTO",
                      align: "START"
                    ),
                    a!gridColumn(
                      label: cons!CR_APP_LAB_AUDIT_DETAILS[7],
                      value: if(
                        rule!APN_isBlank(fv!row.description_txt),
                        null,
                        a!richTextDisplayField(
                          value: a!richTextBulletedList(
                            items: reject(
                              fn!isnull,
                              split(fv!row.description_txt, char(13))
                            )
                          )
                        )
                      ),
                      width: "AUTO",
                      align: "START"
                    )
                  }
                )
              }
            )

    local!data: a!refreshVariable(
    value:rule!CR_APP_QE_getAppAuditBasedOnFilters(
    cif_int: ri!cif_int,
    rowId_int: index(
    ri!crAPPCollateralSelected_cdt,
    "id_int",
    tointeger(null)
    ),
    requestId_int: ri!requestId_int,
    sectionName_txt: ri!sectionName_txt,
    pagingInfo: a!pagingInfo(1,-1)
    ).data,
    refreshAlways: true()
    )

    October 22, 2024

    can we do some how by removing box Layout and grid Field ,using on click of dynamic link it has to show as side by side only?