2008/3/19, Dimitris Mouchritsas <[EMAIL PROTECTED]>: > > Antonio Petrelli wrote: > > 2008/3/19, Dimitris Mouchritsas <[EMAIL PROTECTED]>: > > > >> we're using struts 1.2.4 in our project and I'm trying to implement a > >> back button for a 3 step registration procedure. The problem is I'd > >> like to do it without using javascript. I've discovered html:cancel > >> which works nicely for ...canceling. But I couldn't find anything > similar > >> for the back button. Any ideas? > >> > > > > > > > > You need to manage it on the server side. There are many ways to do it, > just > > to mention a pair: > > 1) the button points to the previous action; > > 2) implement a history manager that manages the history of called > actions > > and, when called "back" (e.g. with a "history action") you go back in > the > > history. > > > > Ciao > > Antonio > > > > > > The first case would suit me fine. But how would I do this exactly? Use > a simple button instead of <html:button> and include it in a <a> element? > I'm trying to do this as uniform as possible as with the other buttons > which are <htm:submit>, <html:reset> and <html:cancel>. > My current code looks like this: > <a href="<%=request.getContextPath()%>/home.do"> > <html:button styleClass="button" property="back"> > <bean:message key="prompt.back.button" /> > </html:button> > </a> > but I still need to add a back property to the form bean which is not > really needed.
The way is simpler than you may think :-) You can create a new *form*, different from the main one, in which there is an <html:submit> button that triggers the action that takes you "back". Antonio