How to use it.

http://www.stripesbook.com/blog/index.php?/archives/29-Stripes-Tip-Use-the-Bean-First-Population-Strategy.html

Ben Gunter schrieb:
> Take a look at BeanFirstPopulationStrategy 
> <http://stripes.sourceforge.net/docs/current/javadoc/net/sourceforge/stripes/tag/BeanFirstPopulationStrategy.html>,
>  
> but beware that it can have unintended consequences for your other 
> ActionBeans.
>
> -Ben
>
> On Wed, May 6, 2009 at 2:22 PM, Jens Zastrow 
> <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     Hi all,
>
>     I have a simple form containing a search field.
>
>     public class Filter {
>        String query;
>        ....
>     }
>
>     <s:text name="filter.query"/>
>
>     A search can be done by sending a POST with a submit-button, that
>     works
>     as expected.
>
>     Now i added a "reset" button which triggers the event "reset" on the
>     stripes-action bean.
>
>     @HandlesEvent( "reset" )
>     public Resolution reset() {
>       // clear the query.
>       getFilter.setQuery("");
>       executeFilter(...);
>       ...
>     }
>
>     This also is ok.
>     The result page again shows correctly the items matching * -
>     effectively
>     all items.
>
>     The problem which now occurs, is that the text-field still shows
>     the old
>     value not the cleaned one - "".
>     I debugged little bit into the stripes-classes and found the
>     reason why:
>
>     [DefaultPopulationStrategy]
>     ----------------------
>     public Object getValue(InputTagSupport tag) throws
>     StripesJspException {
>            // Look first for something that the user submitted in the
>     current request
>     1)     Object value = getValuesFromRequest(tag);
>            // If that's not there, let's look on the ActionBean
>            if (value == null) {
>                value = getValueFromActionBean(tag);
>            }
>     ----------------------
>
>     1)  always the value from the request will be checked first, which
>     prevents the access to the ActionBean.
>
>     One workaround was to reset the request-params manually but this seems
>     very dirty to me.
>     Any ideas to solve this?
>
>     Thanks
>     Jens
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image 
> processing features enabled. http://p.sf.net/sfu/kodak-com
> ------------------------------------------------------------------------
>
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>   


-- 
Dipl. Inform Jens Zastrow
Senior-Java-Developer
Geschäftsführender Gesellschafter / Managing Partner
_______________________________________________________________________
mj-networks GmbH
Strausberger Strasse 44 - 10243 Berlin - Germany
Tel: +49 1511 56 97 870 
E-Mail: [email protected] | Web: www.mj-networks-gmbh.de

Sitz/Place of Business: Berlin, AG Charlottenburg, HRB 117014B
Geschäftsführer/Managing Director: Maher Chamsi, Jens Zastrow 


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to