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 Reply Children
  • 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 Stefan Helzle
    The only way to solve this

    "Only"? Thinking

    If someone is desperate to state-persist in a SAIL interface, and up to the technical challenge (note it's not THAT big of a challenge to do this), it's definitely possible to make each tab click write a state-persistence entry to a specialized DB table, which is queried and referenced each time that site interface is loaded.

  • 0
    Certified Lead Developer
    in reply to jagjots3791

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

  • 0
    Certified Lead Developer
    in reply to Mike Schmitt

    You are right, but before going that route and making it the default in ALL applications at the client, I recommend to think about alternatives.

  • 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 Stefan Helzle

    Yes I agree, especially for an in-use application where there are a large handful of existing sites used by various users, it would be a lot of work to retrofit for universal use.  That's the reason I haven't gone that route (yet) on my current production system - however if I'd been involved in the design from the start, I would probably have opted for implementation of this (designed to be relatively portable) originally.

  • 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.