[ http://mc4j.org/jira/browse/STS-236?page=all ]
Tim Fennell resolved STS-236.
-----------------------------
Resolution: Fixed
I chose door #2. Now the @Wizard annotation takes an optional list of start
events.
> Way to specify the start event(s) in a wizard so that stripes to make it
> easier to start wizard flows
> -----------------------------------------------------------------------------------------------------
>
> Key: STS-236
> URL: http://mc4j.org/jira/browse/STS-236
> Project: Stripes
> Issue Type: Improvement
> Components: ActionBean Dispatching
> Reporter: Tim Fennell
> Assigned To: Tim Fennell
> Fix For: Release 1.4
>
>
> >> From email by Dave Pascal on the Stripes Users List >>
> We have been using Stripes for a recent project and had a use case
> implementation that fit using a Wizard perfectly. We found out quickly that
> unless a varible with the name "_pf" is present, the wizard throws an
> exception,
> which is a problem when you try to render the first panel of the wizard, uless
> you spoof the URL to include the variable (too klugy). Since you cannot
> extend
> annotations, we created a new annotation that contains a list of events which
> indicate which events are the begining of the wizard. We hooked this into the
> property binder to ignore the fields present check so that the first panel of
> the wizard would display. I recommend enhacing the Wizard annotation to do
> this
> so that the default binder configuraed with Stripes
> (OgnlActionBeanPropertyBinder) can see if the event in the ActionBeanContext
> is
> one of the events listed in the Wizard tag in order to ignore the fields
> present
> check. We made it a class level annotation to keep it simple, but in reality
> it
> should be a marker annotation at the method level.
> Here is our implementation:
> @Target(ElementType.TYPE)
> @Retention(RetentionPolicy.RUNTIME)
> public @interface WizardStartEvent {
> String[] events = {};
>
> public String[] events();
> }
> _________________________________________
> @Override
> protected Collection<String> getFieldsPresentInfo(ActionBean bean) {
>
> if (bean.getClass().getAnnotation(Wizard.class) != null) {
> String currentEvent = bean.getContext().getEventName();
> WizardStartEvent annotation =
> bean.getClass().getAnnotation(WizardStartEvent.class);
> String[] events = annotation.events();
> for (String event : events) {
> if (currentEvent.equals(event)) {
> return Collections.emptySet();
> }
> }
> }
> return super.getFieldsPresentInfo(bean);
>
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://mc4j.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development