Stripes

Define EventHandler order for @Wizard ActionBeans

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Validation
  • Labels:
    None

Description

We have a multi-page form, that the user needs to fill step by step and submit the order at the end. We currently use @Wizard for these kind of forms and noticed that it is possible to just enter the data on the first page, manipulate the name="" Attribute of the submit button and jump straight to the last page. Stripes has no way of detecting that several form pages were skipped since the field names never get written to the __fp hidden field.

I think it should be possible to define an order for the eventHandlers. Then stripes can make sure that the eventHandler for step3 gets called after step2. With such a mechanism we can guarantee that the user has passed all steps when he reaches the end of the wizard. I also think that it should be possible to annotate an eventHandler to perform all validations and ignore the values in __fp. This way we can make sure that risky actions like sending an order or saving the record have all values present.

To illustrate what I am thinking about I created an example Gist with the eventHandler order: https://gist.github.com/1072357cbedbcbf0f587

Activity

Hide
Richard Hauswald added a comment - 10/Feb/10 2:47 AM

Maybe we change this to bug or create a new one solving the bug the following way:

I thought adding a "endEvents" property to the Wizard Annotation and a check in the ActionBeanPropertyBinder would solve the problem.

Show
Richard Hauswald added a comment - 10/Feb/10 2:47 AM Maybe we change this to bug or create a new one solving the bug the following way: I thought adding a "endEvents" property to the Wizard Annotation and a check in the ActionBeanPropertyBinder would solve the problem.
Hide
Yves Senn added a comment - 10/Feb/10 2:53 AM

This would solve to forbidden jump problem but it would not solve everything. I think we should tell stripes the order of our eventHandlers in Wizard ActionBeans. This has multiple advantages:

  • You can prevent the user from jumping inside the form. Stripes can make sure that the user passes the form exactly as the developer intended.
  • You can allow "backward navigation" without validation errors. This problem is currently not solved and you have to make a workaround.
  • The order of EventHandlers is also interesting for application logic. You will easily be able to create process bars and other navigation bars.
Show
Yves Senn added a comment - 10/Feb/10 2:53 AM This would solve to forbidden jump problem but it would not solve everything. I think we should tell stripes the order of our eventHandlers in Wizard ActionBeans. This has multiple advantages:
  • You can prevent the user from jumping inside the form. Stripes can make sure that the user passes the form exactly as the developer intended.
  • You can allow "backward navigation" without validation errors. This problem is currently not solved and you have to make a workaround.
  • The order of EventHandlers is also interesting for application logic. You will easily be able to create process bars and other navigation bars.

People

Vote (0)
Watch (0)

Dates

  • Created:
    09/Feb/10 1:09 AM
    Updated:
    10/Feb/10 2:53 AM