Redirecting to default section on site

Certified Senior Developer

Hi,

I am using 'Navigation(Subsections)' Pattern here and put this interface on the site.

So when user come to the site, by default workspace subsection is displayed. Now if user select 'My time' subsection, a grid is displayed and on clicking on link under the name column summary is showed but when user return backs, it redirects to the default 'Workspace' subsection instead by 'My time' subsection. Same is happening if I use record action from the grid.

I also tried by putting the interface in process model and created rule inputs 'activeSubNavSection', 'activeSubNavSubsection' and passed to the PM but to no avail.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Appian interfaces do not persist state. The only way to solve this, is by either opening the record in a second tab, or by embedding the record UI as a child.

  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    What do you mean by "by embedding the record UI as a child."? Can you elaborate?

  • 0
    Certified Lead Developer
    in reply to jagjots3791

    You create a UI that you call to be displayed inside your parent UI.

  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    Well, thats what I am currently doing, calling record UI on parent interface

  • 0
    Certified Lead Developer
    in reply to jagjots3791

    From what I see on your screenshots, you navigate the user away from your site page to the record. When the users clicks "Back" in browser, the site page is reset. Is that correct?

    I suggest to replace the grid with the UI record when the user clicks.

  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    a!localVariables(
      local!subNavSections: {
        a!map(
          sectionName: "Quick Links",
          subsections: { "Workspace", "Tasks",  }
        ),
        a!map(
          sectionName: "Favorites",
          subsections: { "My Time", "Expenses" }
        )
      },
      {
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!forEach(
                  items: local!subNavSections,
                  expression: a!localVariables(
                    local!parentSection: fv!index,
                    {
                      a!richTextDisplayField(
                        labelPosition: if(fv!isFirst, "COLLAPSED", "ABOVE"),
                        value: {
                          a!richTextItem(
                            text: fv!item.sectionName,
                            size: "MEDIUM",
                            style: "STRONG"
                          )
                        }
                      ),
                      a!forEach(
                        items: fv!item.subsections,
                        expression: a!cardLayout(
                          contents: a!richTextDisplayField(
                            labelPosition: "COLLAPSED",
                            value: {
                              a!richTextItem(
                                text: {
                                  a!richTextItem(
                                    text: fv!item,
                                    color: "ACCENT",
                                    size: "STANDARD",
                                    style: if(
                                      and(
                                        local!parentSection = ri!activeSubNavSection,
                                        fv!index = ri!activeSubNavSubsection
                                      ),
                                      "STRONG",
                                      "PLAIN"
                                    )
                                  )
                                }
                              )
                            }
                          ),
                          link: a!dynamicLink(
                            saveInto: {
                              a!save(ri!activeSubNavSubsection, fv!index),
                              a!save(
                                ri!activeSubNavSection,
                                local!parentSection
                              )
                            }
                          ),
                          style: if(
                            and(
                              local!parentSection = ri!activeSubNavSection,
                              fv!index = ri!activeSubNavSubsection
                            ),
                            "ACCENT",
                            "NONE"
                          ),
                          showBorder: false,
                          accessibilityText: if(
                            and(
                              local!parentSection = ri!activeSubNavSection,
                              fv!index = ri!activeSubNavSubsection
                            ),
                            fv!item & " " & "selected",
                            ""
                          )
                        )
                      )
                    }
                  )
                ),
                a!cardLayout(
                  height: "TALL",
                  showWhen: not(a!isPageWidth("PHONE")),
                  showBorder: false
                )
              },
              width: "NARROW"
            ),
            a!columnLayout(
              contents: {
                choose(
                  ri!activeSubNavSection,
                  choose(
                    ri!activeSubNavSubsection,
                    a!sectionLayout(
                      label: index(
                        index(
                          local!subNavSections.subsections,
                          ri!activeSubNavSection,
                          ""
                        ),
                        ri!activeSubNavSubsection,
                        ""
                      ),
                      contents: {}
                    ),
                    a!sectionLayout(
                      label: index(
                        index(
                          local!subNavSections.subsections,
                          ri!activeSubNavSection,
                          ""
                        ),
                        ri!activeSubNavSubsection,
                        ""
                      ),
                      contents: {}
                    )
                  ),
                  choose(
                    ri!activeSubNavSubsection,
                    a!sectionLayout(
                      label: index(
                        index(
                          local!subNavSections.subsections,
                          ri!activeSubNavSection,
                          ""
                        ),
                        ri!activeSubNavSubsection,
                        ""
                      ),
                      contents: { rule!JS_RightContent() }
                    ),
                    a!sectionLayout(
                      label: index(
                        index(
                          local!subNavSections.subsections,
                          ri!activeSubNavSection,
                          ""
                        ),
                        ri!activeSubNavSubsection,
                        ""
                      ),
                      contents: {  }
                    )
                  )
                )
              }
            )
          },
          spacing: "SPARSE",
          showDividers: true
        )
      }
    )

    This is the parent interface in which I am calling 'rule!JS_RightContent()' interface(139th line) which is just a gridfield.

  • 0
    Certified Lead Developer
    in reply to jagjots3791

    For what it's worth, this is a good example for why I typically set my Record Links to open in a new tab - so when the user is done with the record they've opened, they merely close that tab and the original interface will still be in the state they left it.

Reply Children
No Data