You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Marc <ug...@hotmail.com> on 2004/12/07 04:59:39 UTC

two step wizard like interface?

Hi there. Help a struts rookie pls.

I have successfully implemented a two step wizard like interface where I have 
A.jsp for the first step and B.jsp for the second step.

But now I need an ability to dynamically change the jsp file at the step 2 
based on a field selection during step 1 ! 
In other words at step two I might need either B.jsp or C.jsp. 
All three jsp files post to the same action class but are processed by 
different methods(I use DispatchAction and different method names). My problem 
is the form bean class. Currently it has getters/setters for all three jsps 
and this is exactly what I do not want to do.

Is there a more elegant way of doing this ? Can I use different form beans and 
yet use the same action class ?

Thanks in advance.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: two step wizard like interface?

Posted by Joe Germuska <Jo...@Germuska.com>.
This question is probably better suited for the Struts users list; 
the "dev" list is intended more for discussion of developing Struts 
itself, while the "user" list is for developing web applications with 
Struts.

The best solution I can suggest would be to use javascript to 
dynamically change the action of your form so that you submit to the 
action path which is configured for just the form bean you want.  You 
could use MappingDispatchAction instead of LookupDispatchAction and 
have minimal code-rewriting.

If Javascript isn't an option, you could probably make something work 
with action chaining.  Action chaining is not formally supported by 
Struts, but many people use it successfully anyway.

Joe


At 3:59 AM +0000 12/7/04, Marc wrote:
>Hi there. Help a struts rookie pls.
>
>I have successfully implemented a two step wizard like interface where I have
>A.jsp for the first step and B.jsp for the second step.
>
>But now I need an ability to dynamically change the jsp file at the step 2
>based on a field selection during step 1 !
>In other words at step two I might need either B.jsp or C.jsp.
>All three jsp files post to the same action class but are processed by
>different methods(I use DispatchAction and different method names). My problem
>is the form bean class. Currently it has getters/setters for all three jsps
>and this is exactly what I do not want to do.
>
>Is there a more elegant way of doing this ? Can I use different form beans and
>yet use the same action class ?
>
>Thanks in advance.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>For additional commands, e-mail: dev-help@struts.apache.org


-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: two step wizard like interface?

Posted by Dakota Jack <da...@gmail.com>.
I have sent you an answer on the user list under the same subject line

Jack


On Tue, 7 Dec 2004 03:59:39 +0000 (UTC), Marc <ug...@hotmail.com> wrote:
> Hi there. Help a struts rookie pls.
> 
> I have successfully implemented a two step wizard like interface where I have
> A.jsp for the first step and B.jsp for the second step.
> 
> But now I need an ability to dynamically change the jsp file at the step 2
> based on a field selection during step 1 !
> In other words at step two I might need either B.jsp or C.jsp.
> All three jsp files post to the same action class but are processed by
> different methods(I use DispatchAction and different method names). My problem
> is the form bean class. Currently it has getters/setters for all three jsps
> and this is exactly what I do not want to do.
> 
> Is there a more elegant way of doing this ? Can I use different form beans and
> yet use the same action class ?
> 
> Thanks in advance.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
> 


-- 


"You can't wake a person who is pretending to be asleep."

~Native Proverb~

"Each man is good in His sight. It is not necessary for eagles to be crows."

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org