On Mon, 2007-04-30 at 15:07 -0700, Igor Vaynberg wrote:
> On 4/30/07, Martin Grotzke <[EMAIL PROTECTED]> wrote:
>         On Mon, 2007-04-30 at 23:55 +0200, Martin Grotzke wrote:
>         > hi igor,
>         >
>         > i hope i got the idea now. i post my beans here,
>         aehem, sorry - forgot to include SearchResultsView:
>         
>             public SearchResultsView(String id, PropertyModel model )
>         { 
>                 super( id, model );
>                 final String query = (String) getModelObject();
>                 final List<? extends Product> products =
>         ((StealthShopApplication)getApplication()).getSearchService().find( 
> query ); 
>                 setList( products );
> 
> the above isnt right because the list is refreshed only when the
> searchresultsview is created - which only happens once.
hmm, but the SearchPage is created for each request, that shows a
LOG.debug( "Creating new SearchPage with params " + parameters );
that I added to the constructor of the SearchPage.

this should be caused by the onSubmit implementation of the SearchForm:

    protected void onSubmit() {
        // set response page with page params for bookmarkable urls
        final PageParameters params = new PageParameters();
        params.add( "query", (String) getModelObject() );
        setResponsePage( SearchPage.class, params );
    }

which I implemented like this to have bookmarkable urls.
therefore the SearchResultsView is created for each request.

is this wrong in terms of lifecycle of wicket pages?
would there be another possibility to achieve bookmarkable
pages with a form submit?

cheers,
martin


> 
> instead
> 
> class resultsmodel extends abstractreadonlymodel { 
>   private imodel query;
>   public resultsmodel(imodel query) { this.query=query; }
>   public object getobject() {
>        return
> ((StealthShopApplication)getApplication()).getSearchService().find( 
> query.getobject () );
>   }
>   public void detach() { query.detach(); }
> }
> 
> setmodel(new resultsmodel(model));
> 
> that way listview will get fresh results every page refresh
> 
> -igor
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________ Wicket-user mailing list 
> Wicket-user@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/wicket-user
-- 
Martin Grotzke
http://www.javakaffee.de/blog/

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to