Re: [Wicket-user] nice url with submitted form

2007-05-01 Thread Martin Grotzke
On Tue, 2007-05-01 at 09:53 +0200, Eelco Hillenius wrote:
  now we're going to build s.th. like a shop and i'm looking for
 
 A Thai site?
hm? a thai site? what do you mean?

cheers,
martin

 
 Eelco
 
 -
 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/


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


Re: [Wicket-user] nice url with submitted form

2007-05-01 Thread Martin Grotzke
On Tue, 2007-05-01 at 15:36 +0200, Johan Compagner wrote:
 and eelco only dreams thai now so..
ok, then sweet dreams, eelco :)

 
 
 On 5/1/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
  On Tue, 2007-05-01 at 09:53 +0200, Eelco Hillenius wrote:
now we're going to build s.th. like a shop and i'm
 looking for
  
   A Thai site?
  hm? a thai site? what do you mean?
 
 Was a joke. You said 's.th' and .th is Thailand's extension. 
 
 Eelco
 
 
 -
 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
 
 -
 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/


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


Re: [Wicket-user] nice url with submitted form

2007-04-30 Thread Martin Grotzke
hi igor,

thanx a lot for this clarification!

cheers,
martin


On Sun, 2007-04-29 at 18:05 -0700, Igor Vaynberg wrote:
 in reality this isnt how its supposed to work.
 
 usually you would have something like this:
 
 searchpage {
   private criteria crit;
 
searchpage() {
   add(new searchform(form, new PropertyModel(this, crit)); 
   add(new resultsview(view, new PropertyModel(this, crit));
}
 }
 
 that way the form and the view are bound to the same criteria object.
 the form modifies it, and the view renders according to it. you would
 not call any setresponsepage in the form, the same insatance of the
 page would be reused. that is the wicket way. however, if you must
 have that nice bookmarkable url then you need to call
 setresponsepage(class, pageparams) from the form. it is not as clean,
 but it works. 
 
 -igor
 
 On 4/29/07, Martin Grotzke [EMAIL PROTECTED] wrote:
 On Sun, 2007-04-29 at 17:41 -0700, Igor Vaynberg wrote:
  no, once the form is submitted the page is no longer
 bookmarkable and
  so it will lose any bookmarkable/mounted url.
 
  if you want to keep it you can call
 setresponsepage( page.class,
  params) in onsubmit(), but in your case that is silly since
  searchresultspage probably contains the submitted form
 anyways?
 well, i can do this (setResponsePage with params).
 the SearchResultsPage indeed has a also an instance of the
 form, 
 and the user can also initiate a search on the
 SearchResultsPage.
 
 so for each search the SearchForm.onSubmit creates a new
 SearchResultsPage and (indirectly) a new SearchForm...
 
 i just wonder if this this is the way how wicket should work,
 or if 
 this stateless way is s.th. that is not really the target of
 component based frameworks...
 
 thanx  cheers,
 martin
 
 
 
  -igor
 
 
  On 4/29/07, Martin Grotzke  [EMAIL PROTECTED]
 wrote:
  hi all,
 
  i'm just starting with wicket and have a simple
 search
  form, that leads to a SearchResultsPage. 
 
  the SearchResultsPage is mounted as a bookmarkable
 page (via
  mountBookmarkablePage(/search,
 SearchResultsPage.class);),
  although the url that is shown then contains s.th.
 like
  ?wicket:interface=:6:searchForm::IFormSubmitListener...
 
  is it possible to have a nicer url for the submitted
 form?
 
  i'm using wicket 1.2.6 right now...
 
  thanx in advance,
  cheers,
  martin
 
 
 
 
 
 - 
  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
 
 
 
 
 
 -
  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/
 
 
 -
 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
 
 
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express

Re: [Wicket-user] nice url with submitted form

2007-04-30 Thread Martin Grotzke
hi igor,

i'm trying to implement your advice, but don't really know
how to do this.

what would the SearchForm then look like? does the form itself
use the model and how is the input field added to the form?

and how can the ResultsView access the value of the PropertyModel?
the model has a getObject(Component) accessor - does this mean that
the ResultsView would need pass the SearchPage into getObject?

thanx  cheers,
martin



On Sun, 2007-04-29 at 18:05 -0700, Igor Vaynberg wrote:
 in reality this isnt how its supposed to work.
 
 usually you would have something like this:
 
 searchpage {
   private criteria crit;
 
searchpage() {
   add(new searchform(form, new PropertyModel(this, crit)); 
   add(new resultsview(view, new PropertyModel(this, crit));
}
 }
 
 that way the form and the view are bound to the same criteria object.
 the form modifies it, and the view renders according to it. you would
 not call any setresponsepage in the form, the same insatance of the
 page would be reused. that is the wicket way. however, if you must
 have that nice bookmarkable url then you need to call
 setresponsepage(class, pageparams) from the form. it is not as clean,
 but it works. 
 
 -igor
 
 On 4/29/07, Martin Grotzke [EMAIL PROTECTED] wrote:
 On Sun, 2007-04-29 at 17:41 -0700, Igor Vaynberg wrote:
  no, once the form is submitted the page is no longer
 bookmarkable and
  so it will lose any bookmarkable/mounted url.
 
  if you want to keep it you can call
 setresponsepage( page.class,
  params) in onsubmit(), but in your case that is silly since
  searchresultspage probably contains the submitted form
 anyways?
 well, i can do this (setResponsePage with params).
 the SearchResultsPage indeed has a also an instance of the
 form, 
 and the user can also initiate a search on the
 SearchResultsPage.
 
 so for each search the SearchForm.onSubmit creates a new
 SearchResultsPage and (indirectly) a new SearchForm...
 
 i just wonder if this this is the way how wicket should work,
 or if 
 this stateless way is s.th. that is not really the target of
 component based frameworks...
 
 thanx  cheers,
 martin
 
 
 
  -igor
 
 
  On 4/29/07, Martin Grotzke  [EMAIL PROTECTED]
 wrote:
  hi all,
 
  i'm just starting with wicket and have a simple
 search
  form, that leads to a SearchResultsPage. 
 
  the SearchResultsPage is mounted as a bookmarkable
 page (via
  mountBookmarkablePage(/search,
 SearchResultsPage.class);),
  although the url that is shown then contains s.th.
 like
  ?wicket:interface=:6:searchForm::IFormSubmitListener...
 
  is it possible to have a nicer url for the submitted
 form?
 
  i'm using wicket 1.2.6 right now...
 
  thanx in advance,
  cheers,
  martin
 
 
 
 
 
 - 
  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
 
 
 
 
 
 -
  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/
 
 
 -
 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

Re: [Wicket-user] nice url with submitted form

2007-04-30 Thread Martin Grotzke
hi igor,

i hope i got the idea now. i post my beans here, it would be nice
if could tell me if anything's not following the right path :)

// the start page, simply with the search form
public Index(final PageParameters parameters) {
LOG.debug( Creating new Index page with params  + parameters );
add( new SearchForm( searchForm, new Model() ) );
}

// the search form
public SearchForm(String id, IModel model) {
super( id, model );
add( new TextField( query, model ) );
}

@Override
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 );
}

// the search page with form and results
private String _userInput;

public SearchPage(final PageParameters parameters) {
_userInput = parameters.getString( query );
add( new SearchForm( searchForm, new PropertyModel( this, userInput 
) ) ); 
add( new SearchResultsView( productList, new PropertyModel( this, 
userInput ), this ) );
}

public String getUserInput() {
return _userInput;
}

public void setUserInput( String userInput ) {
_userInput = userInput;
}


cheers,
martin


On Mon, 2007-04-30 at 14:02 -0700, Igor Vaynberg wrote:
 i suggest you read here:
 http://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket
 +models
 
 the idea is pretty simple: 
 the form submits its data into a bean, and the view renders according
 to that bean. this is accomplished by having the form and the view's
 models connected to the same bean via models.
 
 -igor
 
 
 On 4/30/07, Martin Grotzke [EMAIL PROTECTED] wrote:
 hi igor,
 
 i'm trying to implement your advice, but don't really know
 how to do this.
 
 what would the SearchForm then look like? does the form itself
 use the model and how is the input field added to the form? 
 
 and how can the ResultsView access the value of the
 PropertyModel?
 the model has a getObject(Component) accessor - does this mean
 that
 the ResultsView would need pass the SearchPage into getObject?
 
 thanx  cheers, 
 martin
 
 
 
 On Sun, 2007-04-29 at 18:05 -0700, Igor Vaynberg wrote:
  in reality this isnt how its supposed to work.
 
  usually you would have something like this:
 
  searchpage { 
private criteria crit;
 
 searchpage() {
add(new searchform(form, new PropertyModel(this,
 crit));
add(new resultsview(view, new PropertyModel(this,
 crit)); 
 }
  }
 
  that way the form and the view are bound to the same
 criteria object.
  the form modifies it, and the view renders according to it.
 you would
  not call any setresponsepage in the form, the same insatance
 of the 
  page would be reused. that is the wicket way. however, if
 you must
  have that nice bookmarkable url then you need to call
  setresponsepage(class, pageparams) from the form. it is not
 as clean,
  but it works. 
 
  -igor
 
  On 4/29/07, Martin Grotzke [EMAIL PROTECTED]
 wrote:
  On Sun, 2007-04-29 at 17:41 -0700, Igor Vaynberg
 wrote: 
   no, once the form is submitted the page is no
 longer
  bookmarkable and
   so it will lose any bookmarkable/mounted url.
  
   if you want to keep it you can call 
  setresponsepage( page.class,
   params) in onsubmit(), but in your case that is
 silly since
   searchresultspage probably contains the submitted
 form
  anyways? 
  well, i can do this (setResponsePage with params).
  the SearchResultsPage indeed has a also an instance
 of the
  form,
  and the user can also initiate a search on the 
  SearchResultsPage.
 
  so for each search the SearchForm.onSubmit creates a
 new
  SearchResultsPage and (indirectly) a new
 SearchForm...
 
  i just wonder if this this is the way how wicket
 should work, 
  or if
  this stateless way is s.th. that is not really the
 target of
  component based frameworks...
 
  thanx  cheers,
  martin
 
 
  
   -igor

Re: [Wicket-user] nice url with submitted form

2007-04-30 Thread Martin Grotzke
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 );
}

@SuppressWarnings(serial)
@Override
protected void populateItem( ListItem listItem ) {
final Product product = 
(Product)listItem.getModelObject();
listItem.add( new Label(id, product.getId() ) );
listItem.add( new Label( title, product.getTitle() ) );
listItem.add( new Label( description, product.getDescription() ) );
listItem.add(new Link(showDetailsLink){
public void onClick(){
PageParameters pp = new PageParameters();
pp.add(productId, product.getId());
setResponsePage(Index.class, pp);
}
});
}

cheers :)
martin


 it would be nice
 if could tell me if anything's not following the right path :)
 
 // the start page, simply with the search form
 public Index(final PageParameters parameters) {
 LOG.debug( Creating new Index page with params  + parameters );
 add( new SearchForm( searchForm, new Model() ) );
 }
 
 // the search form
 public SearchForm(String id, IModel model) {
 super( id, model );
 add( new TextField( query, model ) );
 }
 
 @Override
 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 );
 }
 
 // the search page with form and results
 private String _userInput;
 
 public SearchPage(final PageParameters parameters) {
 _userInput = parameters.getString( query );
 add( new SearchForm( searchForm, new PropertyModel( this, 
 userInput ) ) ); 
 add( new SearchResultsView( productList, new PropertyModel( this, 
 userInput ), this ) );
 }
 
 public String getUserInput() {
 return _userInput;
 }
 
 public void setUserInput( String userInput ) {
 _userInput = userInput;
 }
 
 
 cheers,
 martin
 
 
 On Mon, 2007-04-30 at 14:02 -0700, Igor Vaynberg wrote:
  i suggest you read here:
  http://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket
  +models
  
  the idea is pretty simple: 
  the form submits its data into a bean, and the view renders according
  to that bean. this is accomplished by having the form and the view's
  models connected to the same bean via models.
  
  -igor
  
  
  On 4/30/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  hi igor,
  
  i'm trying to implement your advice, but don't really know
  how to do this.
  
  what would the SearchForm then look like? does the form itself
  use the model and how is the input field added to the form? 
  
  and how can the ResultsView access the value of the
  PropertyModel?
  the model has a getObject(Component) accessor - does this mean
  that
  the ResultsView would need pass the SearchPage into getObject?
  
  thanx  cheers, 
  martin
  
  
  
  On Sun, 2007-04-29 at 18:05 -0700, Igor Vaynberg wrote:
   in reality this isnt how its supposed to work.
  
   usually you would have something like this:
  
   searchpage { 
 private criteria crit;
  
  searchpage() {
 add(new searchform(form, new PropertyModel(this,
  crit));
 add(new resultsview(view, new PropertyModel(this,
  crit)); 
  }
   }
  
   that way the form and the view are bound to the same
  criteria object.
   the form modifies it, and the view renders according to it.
  you would
   not call any setresponsepage in the form, the same insatance
  of the 
   page would be reused. that is the wicket way. however, if
  you must
   have that nice bookmarkable url then you need to call
   setresponsepage(class, pageparams) from the form. it is not
  as clean,
   but it works. 
  
   -igor
  
   On 4/29/07, Martin Grotzke [EMAIL PROTECTED]
  wrote:
   On Sun, 2007-04-29 at 17:41 -0700, Igor Vaynberg
  wrote: 
no, once the form is submitted the page is no
  longer
   bookmarkable and
so

Re: [Wicket-user] nice url with submitted form

2007-04-30 Thread Martin Grotzke
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/


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


Re: [Wicket-user] nice url with submitted form

2007-04-30 Thread Martin Grotzke
On Mon, 2007-04-30 at 15:23 -0700, Igor Vaynberg wrote:
 if you want to maintain the bookmarkable url then no. but this is
 atypical of how wicket lifecycle usually works. 
ok. do I have to take anything in acount if i use wicket in this
atypical way?

however, until now it feels very good to work with wicket, even
with this more action/mvc like (stateless) aproach... :)

 the model i showed is better because if you reuse the
 searchresultsview outside of this lifecycle you are creating it will
 still work properly, but if you have no plans on reusing it then i
 guess what you do will work too. 
ok, i'll keep that in mind.

thanx a lot for your help,
cheers,
martin


 
 -igor
 
 
 On 4/30/07, Martin Grotzke [EMAIL PROTECTED] wrote:
 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/
 
 
 -
 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
 
 
 
 -
 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

Re: [Wicket-user] nice url with submitted form

2007-04-30 Thread Martin Grotzke
On Mon, 2007-04-30 at 15:42 -0700, Igor Vaynberg wrote:
 On 4/30/07, Martin Grotzke [EMAIL PROTECTED] wrote:
 On Mon, 2007-04-30 at 15:23 -0700, Igor Vaynberg wrote:
  if you want to maintain the bookmarkable url then no. but
 this is
  atypical of how wicket lifecycle usually works.
 ok. do I have to take anything in acount if i use wicket in
 this 
 atypical way?
 
 noep, nothing special to watch out for.
cool :)

  
 however, until now it feels very good to work with wicket,
 even 
 with this more action/mvc like (stateless) aproach... :)
 
 it feels even better once you use the normal lifecycle :)
jepp, i believe this :) i have written apps with wingS some times ago
and i loved it - but we could only use for cms-like apps, not for end
users...

now we're going to build s.th. like a shop and i'm looking for
frameworks that match our needs. probably spring-mvc or tapestry would
also be candidates, but what i've read about wicket sounded better :)

cheers,
martin


 
 -igor
  
 
 
  the model i showed is better because if you reuse the
  searchresultsview outside of this lifecycle you are creating
 it will
  still work properly, but if you have no plans on reusing it
 then i
  guess what you do will work too. 
 ok, i'll keep that in mind.
 
 thanx a lot for your help,
 cheers,
 martin
 
 
 
  -igor
 
 
  On 4/30/07, Martin Grotzke [EMAIL PROTECTED]
 wrote:
  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

[Wicket-user] nice url with submitted form

2007-04-29 Thread Martin Grotzke
hi all,

i'm just starting with wicket and have a simple search
form, that leads to a SearchResultsPage.

the SearchResultsPage is mounted as a bookmarkable page (via
mountBookmarkablePage(/search, SearchResultsPage.class);),
although the url that is shown then contains s.th. like
?wicket:interface=:6:searchForm::IFormSubmitListener...

is it possible to have a nicer url for the submitted form?

i'm using wicket 1.2.6 right now...

thanx in advance,
cheers,
martin




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


Re: [Wicket-user] nice url with submitted form

2007-04-29 Thread Martin Grotzke
On Sun, 2007-04-29 at 17:41 -0700, Igor Vaynberg wrote:
 no, once the form is submitted the page is no longer bookmarkable and
 so it will lose any bookmarkable/mounted url.
 
 if you want to keep it you can call setresponsepage(page.class,
 params) in onsubmit(), but in your case that is silly since
 searchresultspage probably contains the submitted form anyways? 
well, i can do this (setResponsePage with params).
the SearchResultsPage indeed has a also an instance of the form,
and the user can also initiate a search on the SearchResultsPage.

so for each search the SearchForm.onSubmit creates a new
SearchResultsPage and (indirectly) a new SearchForm...

i just wonder if this this is the way how wicket should work, or if
this stateless way is s.th. that is not really the target of
component based frameworks...

thanx  cheers,
martin


 
 -igor
 
 
 On 4/29/07, Martin Grotzke [EMAIL PROTECTED] wrote:
 hi all,
 
 i'm just starting with wicket and have a simple search
 form, that leads to a SearchResultsPage.
 
 the SearchResultsPage is mounted as a bookmarkable page (via
 mountBookmarkablePage(/search, SearchResultsPage.class);),
 although the url that is shown then contains s.th. like
 ?wicket:interface=:6:searchForm::IFormSubmitListener...
 
 is it possible to have a nicer url for the submitted form? 
 
 i'm using wicket 1.2.6 right now...
 
 thanx in advance,
 cheers,
 martin
 
 
 
 
 -
 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
 
 
 
 -
 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/


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