James:
The navigation framework we have can also manage complex navigations with
different actions perhaps in differents use cases, for example:


[listCustomers.jsp (is Checkpoint)] -> (vierDetailCustomer) -> [detailCustomer.jsp]

[detailCustomer.jsp] -> (listOperators) -> [listOperators.jsp]


>From listOperators.jsp you could go a step back (to detailCustomer.jsp)
or cancel the process and go to a checkpoint (listCustomers.jsp).

In fact, you could have multiples types of steps (standard, checkpoint,
home, etc) and all is configured in web.xml and a configuration file (xml
based) with no need of extending the request processor nor extending a base
action:

An example of this configuration is:
<navigation>
  <action path="/FirstNavigation">
      <method name="unspecified" stepType="checkpoint" repopulate="true"/>
      <method name="step2" stepType="checkpoint"/>
  </action>
</navigation>

By default, all steps are standard, the configuration is to override the
default behaviour.
If you want to take a look, let me know. The code we have comes tith an
example that manages a navigation as show in the gif I'm attaching.

In the struts config, you can configure the actions to manage the backwards
navigation:
        <global-forwards>
                <forward name="stepBack" path="/stepBack.do"/>
                <forward name="stepToCheckPoint" path="/stepToCheckPoint.do"/>
                <forward name="undoStep" path="/undoStep.do"/>
                <forward name="gotoCheckPoint" path="/gotoCheckPoint.do"/>
        </global-forwards>
<action path="/stepBack" 
type="net.sf.opentranquera.ui.struts.navigation.actions.StepBackAction"/>
                <action path="/stepToCheckPoint" 
type="net.sf.opentranquera.ui.struts.navigation.actions.StepToCheckPointAction"/>
                <action path="/undoStep" 
type="net.sf.opentranquera.ui.struts.navigation.actions.UndoStepAction"/>
                <action path="/gotoCheckPoint" 
type="net.sf.opentranquera.ui.struts.navigation.actions.GotoCheckPointAction"/>

In the action or validation, you could do as follows to return to the last
step (input page)
return mapping.findForward("undoStep");

And in a method completion, when you want to return to the list (for example
a checkpoint) you could do as follows:
return mapping.findForward("gotoCheckPoint");

In the web.xml, you declare the navigation filter:
<filter>
<filter-name>navigationStack</filter-name>
<filter-class>
net.sf.opentranquera.ui.struts.navigation.NavigationFilter
</filter-class>
<init-param>
        <param-name>config</param-name>
        <param-value>/WEB-INF/navigation-config.xml</param-value>
</init-param>
</filter>
<filter-mapping>
        <filter-name>navigationStack</filter-name>
        <url-pattern>*.do</url-pattern>
</filter-mapping>

Cheers.
Guillermo.

>-- Mensaje original --
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>From:  James Sheridan <[EMAIL PROTECTED]>
>To:    'Struts Users Mailing List' <[EMAIL PROTECTED]>
>Subject: RE: Back navigation using application back buttons
>Date:  Wed, 28 Jul 2004 08:43:11 +0100
>
>
>Thanks Niclas for the ideas.
>
>While I think the currentPage/lastPage hidden field idea would work for
the
>simple case I outlined, I don't think it would work for slightly more
>complex case (requirements changing already :-), eg.
>
>(original)     Page1->Page3->Page2->(back)->Page3
>(extended)     Page1->Page3->Page2->(back)->Page3->(back)->Page1
>
>The scheme would be fine until the last (back) at which point the (back)
>would go the Page2 rather than Page1. The essential problem with the scheme
>I think is that it cannot 'remember' further back that previous page, and
>I
>believe the full navigation history needs to be remembered somehow in order
>to navigate back via the original forward path. This is why I was thinking
>of implementing the 'page stack' idea.
>
>However, I must point out that I am very new to Struts and perhaps I am
>missing something. For example perhaps there is some way to preserve the
>hidden fields from previous invocations of pages when navigating back to
>them ?
>
>-- James
>
>-----Original Message-----
>From: Meier, Niclas [mailto:[EMAIL PROTECTED]
>Sent: 27 July 2004 19:06
>To: Struts Users Mailing List
>Subject: RE: Back navigation using application back buttons
>
>
>Hello,
>
>You can try two hidden fields fort he 'currentPage' and 'lastPage'. When
>you
>submit any form with the 'next'-Button you can evalute the request determine
>the next page in your process. If you proceed with the back button, you
can
>go back the the last page:
>
>Example 1
>Page 1 (c:1, l:undef) -[fwd]-> Page 2 (c:2, l:1) -[back]-> Page 1 (c:1,
l:2)
>
>
>Example 2
>Page 1 (c:1, l:undef) -[fwd]-> Page 3 (c:3, l:1) -[fwd]-> Page 2 (c:2,
l:3)
>-[back]-> Page 3 (c:3, l:2)
>
>You can implement this function into Abstract classes (From and Action)
to
>handle the whole navigation. Or you create a dispatcher which all pages
>configured into.
>
>    <action path="/foo/dispatcher" name="naviForm"
>type="com.foo.struts.DispatcherAction">
>      <forward name="1" path="/pages/page1.jsp"/>
>      <forward name="2" path="/pages/page2.jsp"/>
>      <forward name="3" path="/pages/page2.jsp"/>
>    </action>
>
>A good idea maybe the seperation of request handling of the page form,
which
>is related to the page and some stuff you need to prepare the view. I often
>use this pattern with great success.
>
>{Form on Page 1} -[submit]-> FormOneRequestHandlingAction -[forward]->
>DispatcherAction -[forward]-> ViewPreparingActionPageTwo -[forward] ->
>Page2.jsp
>
>The first two actions can decide to return to page 1 and the third action
>will always forward to the jsp.
>
>Regards
>Niclas
>
>-----Original Message-----
>From: James Sheridan [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, July 27, 2004 4:51 PM
>To: '[EMAIL PROTECTED]'
>Subject: Back navigation using application back buttons
>
>Hi,
>
>I am trying to implement a simple Back mechanism which uses Back buttons
>in
>the page (encouraging users to use this rather than browser Back which
is
>not a good idea). Lets call the pages Page1 and Page2. A Page 1 action
>brings user to Page 2. Page 2 has a Back button. The basic mechanism is
>trivial, ie. an action handler for Page 2 Back which forwards to Page1.
>However the problem is I want to be able to go Back to pages other than
>Page1 since the user can also get to Page 2 via Page3. ie. I want to be
able
>to do
>       Page1->Page2->(back)->Page1
>       Page1->Page3->Page2->(back)->Page3
>Is there some way to control the forwarding for the Page2 Back handling
and
>know which page to go back to ? The 'static' mappings I would set up in
>struts-config.xml appear to only allow me to configure navigation back
to
>one specific page. I was considering implementing a 'page stack' object
and
>passing it as a session attribute but I would have hoped that the Struts
>framework would make this possible in some easy way.
>
>I suppose some of the wizard ideas might help but a wizard is essentially
>different from what I cam trying to achieve in the sense that Back in a
>wizard always go back to a specific page.
>
>Any help would be greatly appreciated.
>
>-- James
>
>
>**********************************************************************
>This email and any files transmitted with it are confidential and
>intended solely for the use of the individual or entity to whom they
>are addressed. If you have received this email in error please notify
>the sender.
>
>This footnote also confirms that this email message has been swept by
>MIMEsweeper for the presence of computer viruses.
>
>**********************************************************************
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>**********************************************************************
>This email and any files transmitted with it are confidential and
>intended solely for the use of the individual or entity to whom they
>are addressed. If you have received this email in error please notify
>the sender.
>
>This footnote also confirms that this email message has been swept by
>MIMEsweeper for the presence of computer viruses.
>
>**********************************************************************
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>


________________________________________
FiberTel, el nombre de la banda ancha http://www.fibertel.com.ar



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to