1 Reply Latest reply on Apr 4, 2007 1:58 PM by kingcu

    Question regarding page parameter

    kingcu

      Hi,

      I have a question on using the page parameters. Here is the situation: I have a main page and some child pages, navigation goes from the main page to the child pages and then back to the main page; some state on the main page needs to be kept when going to the child page and restored later when going back to the main page: for example, I have a set of tabs (using rich faces tabpanel), I want to "remember" which tab is selected before going to a child page and later when I come back to the main page, I want to have the previously selected tab displayed.

      So how can I implement this? Any hints?

      Thanks,
      Tong

        • 1. Re: Question regarding page parameter
          kingcu

          I read the pages.dtd to find the action element and got it working with that. Here is how I did it:

          1. Add a String property "selectedTab" to the backing EntityHome of the main page;
          2. In each child page's Seam page config XML (child.page.xml), add an action element that calls "setSelectedTab('value')";
          3. On the main page, using EL to value the selectedTab property of the rich:tabPanel tag.

          I feel that introducing one more property in the backing bean may not be necessary (it also pollutes the EntityHome). I would imagine there be a way to pass parameters around the pages and use their values in EL, but I don't know how. I saw that in pages.dtd, there are also "in" and "out" elements, wonder if these can do exactly what I wanted, but couldn't find their description/usage on the reference doc. Any clarification/education?

          Thanks.