Re: [Wicket-user] What's the best way to optionally add markup?

2007-04-30 Thread Martijn Dashorst
Or you could add an attribute modifier and add a class to the
components, using css to prepend the elements with a *

Martijn

On 5/1/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> that is usually not the wicket way.
>
> there are two different ways to do it based on your usecase.
>
> 1) you can always add the span with * into markup, but hide it by overriding
> isvisible or directly calling setvisible. this is good if you dont have too
> many of these on the screen and so dont care about taking the hit on having
> components that are not visible in your hierarchy.
> 2) conditionally adding the markup with or without the *. this will involve
> having a fragment that contains just the number, and one that contains the
> number and the star, and conditionally adding one or the other.
>
> but like i said it really depends directly on your usecase.
>
> -igor
>
>
>
> On 4/30/07, Lowell Kirsh <[EMAIL PROTECTED] > wrote:
> > I have a table of numbers, and I want to flag each some of them by
> > putting a red star next to them. What's the easiest way to do this? I
> > imagine I'll  have many red stars on the page. Would this be best done
> > with a subclass of Label which renders itself as normal and also
> > appends a '*' to the text from within the java
> > code?
> >
> > Thanks,
> > Lowell
> >
> >
> -
> > 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
>
>


-- 
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

-
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


[Wicket-user] Ajax Request problem with new window tabs (Wicket 1.3 snapshot)

2007-04-30 Thread RedFury

Hi fellow wicket-ers.

I am attempting to write a small wicket app which can use multiple windows. 
The app updates a simple component using an ajax timer.  I am doing a simple
pagemap mapping in my code so I am certain that each window is using a
different pagemap.  

With just one page it is fine, however as soon as I open up a second tab, I
get a "session expired" message in the first tab when it attempts its next
ajax reques.t   When I follow the "return to home page" link the page
refreshes and all is fine again. I compared the two .html pages (the one
which failed and the refreshed one which works) and it seems the only
difference is the value of the wicket:interface value in the ajax calls (0
in the old version, 3 in the new.)  

Now, I know that with multiple window support in wicket, it clones the
original page (or something similar) whenever you open a new tab, is it
possible that this process is somehow incrementing the page version number,
then the ajax request fails because its using the wrong wicket:interface?  I
have tried all sorts of stuff like turning versioning and not just
targetting the 'active' page, but to no avail. 

I did a lot of searches and  have read other similar reports from other
users but the problem never semed to get resolved?

Any help on this matter would be greatly aprpeciated,
I can supply some code if needed.  However even with an almost-blank app
(simple label component and an AjaxSelfUpdating behavior which does nothing)
the "session expired" message still appears in the original tab after
opening a second tab.

Thanks
Dean
-- 
View this message in context: 
http://www.nabble.com/Ajax-Request-problem-with-new-window-tabs-%28Wicket-1.3-snapshot%29-tf3673608.html#a10265163
Sent from the Wicket - User mailing list archive at Nabble.com.
-
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] What's the best way to optionally add markup?

2007-04-30 Thread Igor Vaynberg

that is usually not the wicket way.

there are two different ways to do it based on your usecase.

1) you can always add the span with * into markup, but hide it by overriding
isvisible or directly calling setvisible. this is good if you dont have too
many of these on the screen and so dont care about taking the hit on having
components that are not visible in your hierarchy.
2) conditionally adding the markup with or without the *. this will involve
having a fragment that contains just the number, and one that contains the
number and the star, and conditionally adding one or the other.

but like i said it really depends directly on your usecase.

-igor


On 4/30/07, Lowell Kirsh <[EMAIL PROTECTED]> wrote:


I have a table of numbers, and I want to flag each some of them by
putting a red star next to them. What's the easiest way to do this? I
imagine I'll  have many red stars on the page. Would this be best done
with a subclass of Label which renders itself as normal and also
appends a '*' to the text from within the java
code?

Thanks,
Lowell

-
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


[Wicket-user] What's the best way to optionally add markup?

2007-04-30 Thread Lowell Kirsh
I have a table of numbers, and I want to flag each some of them by
putting a red star next to them. What's the easiest way to do this? I
imagine I'll  have many red stars on the page. Would this be best done
with a subclass of Label which renders itself as normal and also
appends a '*' to the text from within the java
code?

Thanks,
Lowell

-
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] Forgot password feature

2007-04-30 Thread n8han

There's org.apache.wicket.util.crypt.Base64UrlSafe


Tauren Mills-2 wrote:
> 
> Is there a built-in way in Wicket to url-encode the string again,
> making it doubly encoded?  Or is there a different solution?  Perhaps
> using something besides Base64, but I don't know what would be good to
> use.
> 

-- 
View this message in context: 
http://www.nabble.com/Forgot-password-feature-tf3670993.html#a10264272
Sent from the Wicket - User mailing list archive at Nabble.com.


-
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] Button using button tag instead of input

2007-04-30 Thread Igor Vaynberg

use link or submitlink.

-igor


On 4/30/07, Ryan Sonnek <[EMAIL PROTECTED]> wrote:


I'm trying to use a wicket Button on an html  tag instead of
an  tag, but wicket keeps throwing this error:
WicketMessage: Component deleteSlideButton must be applied to a tag of
type 'input', not ''

Is this possible, or is there a different wicket object that I can use?

-
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


[Wicket-user] Button using button tag instead of input

2007-04-30 Thread Ryan Sonnek
I'm trying to use a wicket Button on an html  tag instead of
an  tag, but wicket keeps throwing this error:
WicketMessage: Component deleteSlideButton must be applied to a tag of
type 'input', not ''

Is this possible, or is there a different wicket object that I can use?

-
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


[Wicket-user] wicket-bench for 1.3-SNAPSHOT

2007-04-30 Thread Ryan Sonnek
is there anyone from the wicket-bench team out there that can provide
info on a new version for the upcoming 1.3 release?  now that the
package names have changed, my wicket bench tests are totally hosed
up...

-
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: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
> 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 () );
> > >   }
> >

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

2007-04-30 Thread Igor Vaynberg

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.



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 :)

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

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 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 o

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

2007-04-30 Thread Igor Vaynberg

if you want to maintain the bookmarkable url then no. but this is atypical
of how wicket lifecycle usually works. 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.

-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 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/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Forgot password feature

2007-04-30 Thread Tauren Mills
One more thing on this.  I have it working so that my URL looks like this:

/sa/app/reset/1/4xYD6JctlSPwU23eN%2Fm1isA5Cf8%3D/0/tauren

The "key" is the PageParameter #1.  I'm encoding a value using Base64,
which appears to include slashes, =, etc.  When this string is used in
a browser, the value is URLdecoded and ends up with an extra slash,
which messes everything up:

ERROR RequestCycle - URL fragment has unmatched key/value pair:
1/4xYD6JctlSPwU23eN/m1isA5Cf8=/0/tauren

Is there a built-in way in Wicket to url-encode the string again,
making it doubly encoded?  Or is there a different solution?  Perhaps
using something besides Base64, but I don't know what would be good to
use.

Thanks,
Tauren



On 4/30/07, Tauren Mills <[EMAIL PROTECTED]> wrote:
> Igor,
>
> Thanks so much!
>
> Tauren
>
>
> On 4/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > class resetpage extends webpage {
> >  public resetpage(pageparameters params) {
> >string key=params.get(0);
> >...
> >   }
> >
> >   public static urlfor(string key) {
> >pageparameters params=new pageparameters();
> >params.put("0", key);
> >return requestcycle.get().urlfor(resetpage.class, params);
> >}
> > }
> >
> > app.init() {
> >   mount("/reset", new indexedurlcodingstrategy(resetpage.class));
> > }
> >
> > resetpage.urlfor(key) should return something like /context/reset/yourkey
> > and you can email that to the user
> >
> > -igor
> >
> >
> >
> > On 4/30/07, Tauren Mills <[EMAIL PROTECTED]> wrote:
> > >
> > > I'm considering different ways to implement a "Forgot Password"
> > > feature.  I normally see it done one of two ways.
> > >
> > > 1.  On registration, get a Question and Answer from user.  Ask them
> > > this question when they forget their password.  On correct answer, let
> > > them change password.  I don't have any questions on implementing this
> > > method.
> > >
> > > 2.  When password is forgotten, they put in their email address.  A
> > > confirmation email is sent to user and they must click onto a link.
> > > On the response page, they can change their password.
> > >
> > > My preference is to implement #2. But I'm unclear on how to create a
> > > "confirmation link" and a page to read it.  I'd need to add a unique
> > > key of some sort to a URL.  That URL can't be session specific.
> > >
> > > Any suggestions on how to format this confirmation URL and what would
> > > need to go into the page's java to read the key from the URL?
> > >
> > > Thanks!
> > > Tauren
> > >
> > >
> > -
> > > 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
> >
> >
>

-
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: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 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 Igor Vaynberg

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 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.

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


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 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:
> > 

[Wicket-user] Google Guice

2007-04-30 Thread cowwoc
http://video.google.com/videoplay?docid=6068447410873108038&q=user%3A%22Google+engEDU

This might be of interest to Wicket and its users. I personally like
their design :)

Gili



signature.asc
Description: OpenPGP digital signature
-
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,

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

Re: [Wicket-user] from 1.2.6 to 1.3.0 snapshot

2007-04-30 Thread Eelco Hillenius
The issue you reported doesn't make sense to me atm, but I'm sure it's
not bug free yet. However, it'll be someday (and hopefully that is
soon), and the issue is not related to the datepicker I think. The
datetime project is still new, and the datepicker more limited than
the old one, but we can all work on that :)

Eelco


On 4/30/07, Martin Funk <[EMAIL PROTECTED]> wrote:
> Sorry Eelco for beeing such a pain ;-)
>
> but unless I missed something, wicket-datetime's DateField is still
> throwing NPE's, making it somewhat hard to use.
>
> Martin
>
> Eelco Hillenius schrieb:
> > yeah. And there's a separate project with a new datepicker now as
> > well: wicket-datetime.
> >
> > Eelco
> >
> > On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> >> ok, found it: 
> >> http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-datepicker
> >>
> >>
> >> -Original Message-
> >> From: [EMAIL PROTECTED] on behalf of [EMAIL PROTECTED]
> >> Sent: Mon 4/30/2007 3:52 PM
> >> To: wicket-user@lists.sourceforge.net
> >> Subject: from 1.2.6 to 1.3.0 snapshot
> >>
> >> Ta, I've just upgraded and prefixed all wicket imports with org.apache.
> >>
> >> Only problemo seems to be that
> >>
> >> wicket.extensions.markup.html.datepicker.DatePicker
> >>
> >> has disappeared.
> >>
> >> Any idea where it went?
> >>
> >> Derek
> >>
> >>
> >> -Original Message-
> >> From: [EMAIL PROTECTED] on behalf of Matej Knopp
> >> Sent: Mon 4/30/2007 2:10 PM
> >> To: wicket-user@lists.sourceforge.net
> >> Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
> >>
> >> hi,
> >>
> >> i just want to mentioned that there were a nasty bug in 1.3 nested
> >> form processing that was fixed today, so if you have any issues with
> >> it i suggest you upgrading wicket to see if it helps.
> >>
> >> -Matej
> >>
> >> On 4/30/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> >>
> >>> As for your first question, I think the following is a better approach:
> >>>
> >>>
> >>> public AddressFieldsetPanel(String id, IModel address) {
> >>> super(id, new CompoundPropertyModel(address));
> >>> }
> >>>
> >>> and :
> >>>
> >>> form.add(new AddressFieldsetPanel("billing", new
> >>> PropertyModel(form.getModel(), "billing";
> >>> form.add(new AddressFieldsetPanel("shipping", new
> >>> PropertyModel(form.getModel(), "shipping";
> >>>
> >>> then the wiring of the addresses can be done in the model object itself:
> >>>
> >>> Invoice invoice = new Invoice();
> >>> invoice.setBilling(new Address());
> >>> invoice.setShipping(new Address());
> >>>
> >>> Martijn
> >>>
> >>> On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >>>
> > imho all he should do is extend a panel, and make sure that panel is 
> > always inside a form.
> > there is no need to have a form to group a few fields together.
> >
>  Thanks, that's how I was thinking it should be a Fieldset so to speak. 
>  Have progressed a bit
>  down that route but still have a couple of related questions.
> 
>  Am new to Wicket and trying to learn how to do forms (binding and 
>  validation) the Wicket way.
>  Here's where I'm at so far with a simplistic example I'm using 
>  (abbreviated syntax for clarity):
> 
>  PurchaseOrder {
>   String customerName
>   PostalAddress deliveryAddress
>   PostalAddress invoiceAddress
>  }
> 
>  PostalAddress {
>   String addressLine
>   String municipality
>   String postalCode
>   String country
>  }
> 
>  PurchaseOrderForm extends Form
>  {
> public PurchaseOrderForm(String name)
> {
>    super(name, new CompoundPropertyModel(new PurchaseOrder()));
>    add(new RequiredTextField("customerName"));
>    add(new PostalAddressFieldset("deliveryAddress", new 
>  PostalAddress()));  //  ???
>    add(new PostalAddressFieldset("invoiceAddress", new 
>  PostalAddress()));   //  ???
> )
>  }
> 
>  PostalAddressFieldset extends Panel
>  {
>  public PostalAddressFieldset(String id, PostalAddress postalAddress) 
>    // ???
>  {
>    super(id, new CompoundPropertyModel(postalAddress));  // ???
>    add(new RequiredTextField("addressLine"));
>    add(new RequiredTextField("municipality"));
>    add(new RequiredTextField("postalCode"));
>    add(new RequiredTextField("country"));
>  }
> 
>  Bit I'm not sure about is how to wire up the binding of the nested model 
>  object (PostalAddress)
>  to the nested Fieldset (PostalAddressFieldset), see question marks in 
>  comments above.
>  Have done it like this so far to get it to compile but it is obviously 
>  wrong as I'm
>  interested in the nested PostalAddress objects, not new ones.
> 
>  Second question is whether Wicket provides support for creating unique 
>  id's for elements.
>  My html for 

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

2007-04-30 Thread Igor Vaynberg

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
> >
> >
> > 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.source

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 

Re: [Wicket-user] from 1.2.6 to 1.3.0 snapshot

2007-04-30 Thread Martin Funk
Sorry Eelco for beeing such a pain ;-)

but unless I missed something, wicket-datetime's DateField is still 
throwing NPE's, making it somewhat hard to use.

Martin

Eelco Hillenius schrieb:
> yeah. And there's a separate project with a new datepicker now as
> well: wicket-datetime.
>
> Eelco
>
> On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>   
>> ok, found it: 
>> http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-datepicker
>>
>>
>> -Original Message-
>> From: [EMAIL PROTECTED] on behalf of [EMAIL PROTECTED]
>> Sent: Mon 4/30/2007 3:52 PM
>> To: wicket-user@lists.sourceforge.net
>> Subject: from 1.2.6 to 1.3.0 snapshot
>>
>> Ta, I've just upgraded and prefixed all wicket imports with org.apache.
>>
>> Only problemo seems to be that
>>
>> wicket.extensions.markup.html.datepicker.DatePicker
>>
>> has disappeared.
>>
>> Any idea where it went?
>>
>> Derek
>>
>>
>> -Original Message-
>> From: [EMAIL PROTECTED] on behalf of Matej Knopp
>> Sent: Mon 4/30/2007 2:10 PM
>> To: wicket-user@lists.sourceforge.net
>> Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
>>
>> hi,
>>
>> i just want to mentioned that there were a nasty bug in 1.3 nested
>> form processing that was fixed today, so if you have any issues with
>> it i suggest you upgrading wicket to see if it helps.
>>
>> -Matej
>>
>> On 4/30/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
>> 
>>> As for your first question, I think the following is a better approach:
>>>
>>>
>>> public AddressFieldsetPanel(String id, IModel address) {
>>> super(id, new CompoundPropertyModel(address));
>>> }
>>>
>>> and :
>>>
>>> form.add(new AddressFieldsetPanel("billing", new
>>> PropertyModel(form.getModel(), "billing";
>>> form.add(new AddressFieldsetPanel("shipping", new
>>> PropertyModel(form.getModel(), "shipping";
>>>
>>> then the wiring of the addresses can be done in the model object itself:
>>>
>>> Invoice invoice = new Invoice();
>>> invoice.setBilling(new Address());
>>> invoice.setShipping(new Address());
>>>
>>> Martijn
>>>
>>> On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>>   
> imho all he should do is extend a panel, and make sure that panel is 
> always inside a form.
> there is no need to have a form to group a few fields together.
>   
 Thanks, that's how I was thinking it should be a Fieldset so to speak. 
 Have progressed a bit
 down that route but still have a couple of related questions.

 Am new to Wicket and trying to learn how to do forms (binding and 
 validation) the Wicket way.
 Here's where I'm at so far with a simplistic example I'm using 
 (abbreviated syntax for clarity):

 PurchaseOrder {
  String customerName
  PostalAddress deliveryAddress
  PostalAddress invoiceAddress
 }

 PostalAddress {
  String addressLine
  String municipality
  String postalCode
  String country
 }

 PurchaseOrderForm extends Form
 {
public PurchaseOrderForm(String name)
{
   super(name, new CompoundPropertyModel(new PurchaseOrder()));
   add(new RequiredTextField("customerName"));
   add(new PostalAddressFieldset("deliveryAddress", new 
 PostalAddress()));  //  ???
   add(new PostalAddressFieldset("invoiceAddress", new 
 PostalAddress()));   //  ???
)
 }

 PostalAddressFieldset extends Panel
 {
 public PostalAddressFieldset(String id, PostalAddress postalAddress)   
 // ???
 {
   super(id, new CompoundPropertyModel(postalAddress));  // ???
   add(new RequiredTextField("addressLine"));
   add(new RequiredTextField("municipality"));
   add(new RequiredTextField("postalCode"));
   add(new RequiredTextField("country"));
 }

 Bit I'm not sure about is how to wire up the binding of the nested model 
 object (PostalAddress)
 to the nested Fieldset (PostalAddressFieldset), see question marks in 
 comments above.
 Have done it like this so far to get it to compile but it is obviously 
 wrong as I'm
 interested in the nested PostalAddress objects, not new ones.

 Second question is whether Wicket provides support for creating unique 
 id's for elements.
 My html for the PostalAddressFieldset includes things like:

 

 Obviously this is no good as when I use this component multiple times on a 
 form, I end up
 with multiple fields with the same id.

 Any advice on best practice or pointers to examples that demonstrate these 
 techniques would be
 appreciated.

 Cheers,
 Derek









 -Original Message-
 From: [EMAIL PROTECTED] on behalf of Igor Vaynberg
 Sent: Sun 4/29/2007 8:19 PM
 To: wicket-user@lists.sourceforge.net
 Subject: Re: [Wicket-user] Nested Forms and on

Re: [Wicket-user] Cancel doesn't work for AjaxEditableLabel (1.3.0-incubating-SNAPSHOT)

2007-04-30 Thread Dragos Bobes
I've just noticed that the behaviour is specific to Firefox 2.0. In 
Internet Explorer 7 everything works fine.

Thanks,
Dragos

Dragos Bobes wrote:
> Hey guys,
>
> I'm a newbie with wicket so it may be my fault but I tried to debug this 
> error and I couldn't find any solutions.
> I build a simple page with an editable ajax label, everything works fine 
> except when I try to cancel the changes (using the Esc key). After that 
> all AJAX features stop working with a "INFO: Channel busy - 
> postponing..." error.
> Bellow is a snapshot from AJAX debug:
>
> 
> INFO: Response parsed. Now invoking steps...
> INFO: Response processed successfully.
> INFO: Invoking post-call handler(s)...
> INFO: last focus id was not set
> INFO:
> INFO: Initiating Ajax GET request on 
> Help?wicket:interface=:1:editableLabel:editor::IBehaviorListener:0&wicket:ignoreIfNotActive=true&save=false&random=0.5459241681095125
> INFO: Invoking pre-call handler(s)...
> INFO: Channel busy - postponing...
>
>
> My code:
> AjaxEditableLabel label = new AjaxEditableLabel("editableLabel", 
> new PropertyModel(this, "name"));
> add(label);
>
> Html:
>  Something
>
> Please let me know if this is a known issue or if there is something 
> missing in my code (I'm using 1.3.0-incubating-SNAPSHOT).
>
> Thanks,
> Dragos
>
>
> -
> 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


Re: [Wicket-user] from 1.2.6 to 1.3.0 snapshot

2007-04-30 Thread Eelco Hillenius
yeah. And there's a separate project with a new datepicker now as
well: wicket-datetime.

Eelco

On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> ok, found it: 
> http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-datepicker
>
>
> -Original Message-
> From: [EMAIL PROTECTED] on behalf of [EMAIL PROTECTED]
> Sent: Mon 4/30/2007 3:52 PM
> To: wicket-user@lists.sourceforge.net
> Subject: from 1.2.6 to 1.3.0 snapshot
>
> Ta, I've just upgraded and prefixed all wicket imports with org.apache.
>
> Only problemo seems to be that
>
> wicket.extensions.markup.html.datepicker.DatePicker
>
> has disappeared.
>
> Any idea where it went?
>
> Derek
>
>
> -Original Message-
> From: [EMAIL PROTECTED] on behalf of Matej Knopp
> Sent: Mon 4/30/2007 2:10 PM
> To: wicket-user@lists.sourceforge.net
> Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
>
> hi,
>
> i just want to mentioned that there were a nasty bug in 1.3 nested
> form processing that was fixed today, so if you have any issues with
> it i suggest you upgrading wicket to see if it helps.
>
> -Matej
>
> On 4/30/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> > As for your first question, I think the following is a better approach:
> >
> >
> > public AddressFieldsetPanel(String id, IModel address) {
> > super(id, new CompoundPropertyModel(address));
> > }
> >
> > and :
> >
> > form.add(new AddressFieldsetPanel("billing", new
> > PropertyModel(form.getModel(), "billing";
> > form.add(new AddressFieldsetPanel("shipping", new
> > PropertyModel(form.getModel(), "shipping";
> >
> > then the wiring of the addresses can be done in the model object itself:
> >
> > Invoice invoice = new Invoice();
> > invoice.setBilling(new Address());
> > invoice.setShipping(new Address());
> >
> > Martijn
> >
> > On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > > imho all he should do is extend a panel, and make sure that panel is 
> > > > always inside a form.
> > > > there is no need to have a form to group a few fields together.
> > >
> > > Thanks, that's how I was thinking it should be a Fieldset so to speak. 
> > > Have progressed a bit
> > > down that route but still have a couple of related questions.
> > >
> > > Am new to Wicket and trying to learn how to do forms (binding and 
> > > validation) the Wicket way.
> > > Here's where I'm at so far with a simplistic example I'm using 
> > > (abbreviated syntax for clarity):
> > >
> > > PurchaseOrder {
> > >  String customerName
> > >  PostalAddress deliveryAddress
> > >  PostalAddress invoiceAddress
> > > }
> > >
> > > PostalAddress {
> > >  String addressLine
> > >  String municipality
> > >  String postalCode
> > >  String country
> > > }
> > >
> > > PurchaseOrderForm extends Form
> > > {
> > >public PurchaseOrderForm(String name)
> > >{
> > >   super(name, new CompoundPropertyModel(new PurchaseOrder()));
> > >   add(new RequiredTextField("customerName"));
> > >   add(new PostalAddressFieldset("deliveryAddress", new 
> > > PostalAddress()));  //  ???
> > >   add(new PostalAddressFieldset("invoiceAddress", new 
> > > PostalAddress()));   //  ???
> > >)
> > > }
> > >
> > > PostalAddressFieldset extends Panel
> > > {
> > > public PostalAddressFieldset(String id, PostalAddress postalAddress)  
> > >  // ???
> > > {
> > >   super(id, new CompoundPropertyModel(postalAddress));  // ???
> > >   add(new RequiredTextField("addressLine"));
> > >   add(new RequiredTextField("municipality"));
> > >   add(new RequiredTextField("postalCode"));
> > >   add(new RequiredTextField("country"));
> > > }
> > >
> > > Bit I'm not sure about is how to wire up the binding of the nested model 
> > > object (PostalAddress)
> > > to the nested Fieldset (PostalAddressFieldset), see question marks in 
> > > comments above.
> > > Have done it like this so far to get it to compile but it is obviously 
> > > wrong as I'm
> > > interested in the nested PostalAddress objects, not new ones.
> > >
> > > Second question is whether Wicket provides support for creating unique 
> > > id's for elements.
> > > My html for the PostalAddressFieldset includes things like:
> > >
> > > 
> > >
> > > Obviously this is no good as when I use this component multiple times on 
> > > a form, I end up
> > > with multiple fields with the same id.
> > >
> > > Any advice on best practice or pointers to examples that demonstrate 
> > > these techniques would be
> > > appreciated.
> > >
> > > Cheers,
> > > Derek
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > -Original Message-
> > > From: [EMAIL PROTECTED] on behalf of Igor Vaynberg
> > > Sent: Sun 4/29/2007 8:19 PM
> > > To: wicket-user@lists.sourceforge.net
> > > Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
> > >
> > > imho all he should do is extend a panel, and make sure that panel is 
> > > always inside a form.
> > >
> > > there is no need to have a form to group a few fiel

Re: [Wicket-user] Forgot password feature

2007-04-30 Thread Tauren Mills
Igor,

Thanks so much!

Tauren


On 4/30/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> class resetpage extends webpage {
>  public resetpage(pageparameters params) {
>string key=params.get(0);
>...
>   }
>
>   public static urlfor(string key) {
>pageparameters params=new pageparameters();
>params.put("0", key);
>return requestcycle.get().urlfor(resetpage.class, params);
>}
> }
>
> app.init() {
>   mount("/reset", new indexedurlcodingstrategy(resetpage.class));
> }
>
> resetpage.urlfor(key) should return something like /context/reset/yourkey
> and you can email that to the user
>
> -igor
>
>
>
> On 4/30/07, Tauren Mills <[EMAIL PROTECTED]> wrote:
> >
> > I'm considering different ways to implement a "Forgot Password"
> > feature.  I normally see it done one of two ways.
> >
> > 1.  On registration, get a Question and Answer from user.  Ask them
> > this question when they forget their password.  On correct answer, let
> > them change password.  I don't have any questions on implementing this
> > method.
> >
> > 2.  When password is forgotten, they put in their email address.  A
> > confirmation email is sent to user and they must click onto a link.
> > On the response page, they can change their password.
> >
> > My preference is to implement #2. But I'm unclear on how to create a
> > "confirmation link" and a page to read it.  I'd need to add a unique
> > key of some sort to a URL.  That URL can't be session specific.
> >
> > Any suggestions on how to format this confirmation URL and what would
> > need to go into the page's java to read the key from the URL?
> >
> > Thanks!
> > Tauren
> >
> >
> -
> > 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
>
>

-
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] Forgot password feature

2007-04-30 Thread Igor Vaynberg

class resetpage extends webpage {
public resetpage(pageparameters params) {
  string key=params.get(0);
  ...
 }

 public static urlfor(string key) {
  pageparameters params=new pageparameters();
  params.put("0", key);
  return requestcycle.get().urlfor(resetpage.class, params);
  }
}

app.init() {
 mount("/reset", new indexedurlcodingstrategy(resetpage.class));
}

resetpage.urlfor(key) should return something like /context/reset/yourkey
and you can email that to the user

-igor


On 4/30/07, Tauren Mills <[EMAIL PROTECTED]> wrote:


I'm considering different ways to implement a "Forgot Password"
feature.  I normally see it done one of two ways.

1.  On registration, get a Question and Answer from user.  Ask them
this question when they forget their password.  On correct answer, let
them change password.  I don't have any questions on implementing this
method.

2.  When password is forgotten, they put in their email address.  A
confirmation email is sent to user and they must click onto a link.
On the response page, they can change their password.

My preference is to implement #2. But I'm unclear on how to create a
"confirmation link" and a page to read it.  I'd need to add a unique
key of some sort to a URL.  That URL can't be session specific.

Any suggestions on how to format this confirmation URL and what would
need to go into the page's java to read the key from the URL?

Thanks!
Tauren

-
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


[Wicket-user] Forgot password feature

2007-04-30 Thread Tauren Mills
I'm considering different ways to implement a "Forgot Password"
feature.  I normally see it done one of two ways.

1.  On registration, get a Question and Answer from user.  Ask them
this question when they forget their password.  On correct answer, let
them change password.  I don't have any questions on implementing this
method.

2.  When password is forgotten, they put in their email address.  A
confirmation email is sent to user and they must click onto a link.
On the response page, they can change their password.

My preference is to implement #2. But I'm unclear on how to create a
"confirmation link" and a page to read it.  I'd need to add a unique
key of some sort to a URL.  That URL can't be session specific.

Any suggestions on how to format this confirmation URL and what would
need to go into the page's java to read the key from the URL?

Thanks!
Tauren

-
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] Back-button / versioning

2007-04-30 Thread Igor Vaynberg

seeing how slow we were at fixing issues with this i dont have any
objections.

i did fix the error reporting though. before the exceptions were swallowed
and just did e.printstacktrace(). now a proper rte is thrown.

-igor


On 4/30/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:


I've complained about custom serialization being the default before,
and I've had it with that thing. I've reported at least two instances
of problems before in threads on I believe the dev list, and they
haven't been fixed so far either. I really want to set the default to
DefaultObjectStreamFactory now. I still understand we need test hours
and people reporting their issues if we ever want to get this stable,
but so far, the test cases are still minimal, reported problems
weren't solved immediately and an issue like Joshua just reported
shows that not only there are bugs in it, but that the reporting of
problems leaves something to be desired as well (btw, Joshua said he
is using a current snapshot).

So, any final objections before I make that change? I want to set it
as the default, and leave it like that in any future 1.3 release. By
the time we have it all fixed nicely, we can just promote people to
turn custom serialization on themselves.

Eelco


On 4/30/07, Joshua Lim <[EMAIL PROTECTED]> wrote:
> Hi
>
> I was having a little problem with back-button and versioning... I am
using
> 1.3 snapshot from trunk. (as of today)
>
> I have a few wicket pages :- ParentPage contains a form and a submit
button
> without form components. ChildPage(s) of this ParentPage calls
> getForm().add(some component).
>
> The pages all work fine and everything flows correctly.
>
> But when I tried to use the back button and submit again, I get a "Page
> Expired". I know that by default that Pages are versioned but Forms are
not
> (?) according to the wiki...
>
> > "Pages are versioned by default but Forms are not. If you want to make
a
> form versioned call form.setVersioned(true) on the form right after all
> components have been added (not before). This holds at least for wicket
> version 1.2.2"
>
> but setVersion(true) didn't seem to do the trick.
>
> However, Eelco suggested to setObjectStreamFactory to the
> DefaultObjectStreamFactory in the application init, and this actually
made
> all the back-button submit workThanks again Eelco
>
>  Objects.setObjectStreamFactory (new
> IObjectStreamFactory.DefaultObjectStreamFactory());
>
> Joshua
>
>
>
>
-
> 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

-
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


[Wicket-user] Cancel doesn't work for AjaxEditableLabel (1.3.0-incubating-SNAPSHOT)

2007-04-30 Thread Dragos Bobes
Hey guys,

I'm a newbie with wicket so it may be my fault but I tried to debug this 
error and I couldn't find any solutions.
I build a simple page with an editable ajax label, everything works fine 
except when I try to cancel the changes (using the Esc key). After that 
all AJAX features stop working with a "INFO: Channel busy - 
postponing..." error.
Bellow is a snapshot from AJAX debug:


INFO: Response parsed. Now invoking steps...
INFO: Response processed successfully.
INFO: Invoking post-call handler(s)...
INFO: last focus id was not set
INFO:
INFO: Initiating Ajax GET request on 
Help?wicket:interface=:1:editableLabel:editor::IBehaviorListener:0&wicket:ignoreIfNotActive=true&save=false&random=0.5459241681095125
INFO: Invoking pre-call handler(s)...
INFO: Channel busy - postponing...


My code:
AjaxEditableLabel label = new AjaxEditableLabel("editableLabel", 
new PropertyModel(this, "name"));
add(label);

Html:
 Something

Please let me know if this is a known issue or if there is something 
missing in my code (I'm using 1.3.0-incubating-SNAPSHOT).

Thanks,
Dragos


-
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] Back-button / versioning

2007-04-30 Thread Eelco Hillenius
I've complained about custom serialization being the default before,
and I've had it with that thing. I've reported at least two instances
of problems before in threads on I believe the dev list, and they
haven't been fixed so far either. I really want to set the default to
DefaultObjectStreamFactory now. I still understand we need test hours
and people reporting their issues if we ever want to get this stable,
but so far, the test cases are still minimal, reported problems
weren't solved immediately and an issue like Joshua just reported
shows that not only there are bugs in it, but that the reporting of
problems leaves something to be desired as well (btw, Joshua said he
is using a current snapshot).

So, any final objections before I make that change? I want to set it
as the default, and leave it like that in any future 1.3 release. By
the time we have it all fixed nicely, we can just promote people to
turn custom serialization on themselves.

Eelco


On 4/30/07, Joshua Lim <[EMAIL PROTECTED]> wrote:
> Hi
>
> I was having a little problem with back-button and versioning... I am using
> 1.3 snapshot from trunk. (as of today)
>
> I have a few wicket pages :- ParentPage contains a form and a submit button
> without form components. ChildPage(s) of this ParentPage calls
> getForm().add(some component).
>
> The pages all work fine and everything flows correctly.
>
> But when I tried to use the back button and submit again, I get a "Page
> Expired". I know that by default that Pages are versioned but Forms are not
> (?) according to the wiki...
>
> > "Pages are versioned by default but Forms are not. If you want to make a
> form versioned call form.setVersioned(true) on the form right after all
> components have been added (not before). This holds at least for wicket
> version 1.2.2"
>
> but setVersion(true) didn't seem to do the trick.
>
> However, Eelco suggested to setObjectStreamFactory to the
> DefaultObjectStreamFactory in the application init, and this actually made
> all the back-button submit workThanks again Eelco
>
>  Objects.setObjectStreamFactory (new
> IObjectStreamFactory.DefaultObjectStreamFactory());
>
> Joshua
>
>
>
> -
> 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


Re: [Wicket-user] Nested Forms and onSubmit()?

2007-04-30 Thread Martijn Dashorst
On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Ok, but name != id in xhtml and the value of xhtml id attributes on the page 
> must be unique
> or it isn't valid.
>
> Do I need to ensure that any custom components do not include an xhtml id 
> attribute?

Yes you do, but you can let Wicket generate the id's for you with
setOutputMarkupId(true). Wicket will take care of making them unique
in your page.

Martijn

-- 
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

-
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


[Wicket-user] Back-button / versioning

2007-04-30 Thread Joshua Lim

Hi

I was having a little problem with back-button and versioning... I am using
1.3 snapshot from trunk. (as of today)

I have a few wicket pages :- ParentPage contains a form and a submit button
without form components. ChildPage(s) of this ParentPage calls
getForm().add(some component).

The pages all work fine and everything flows correctly.

But when I tried to use the back button and submit again, I get a "Page
Expired". I know that by default that Pages are versioned but Forms are not
(?) according to the wiki...

"Pages are versioned by default but Forms are not. If you want to make a

form versioned call form.setVersioned(true) on the form right after all
components have been added (not before). This holds at least for wicket
version 1.2.2"



but setVersion(true) didn't seem to do the trick.

However, Eelco suggested to setObjectStreamFactory to the
DefaultObjectStreamFactory in the application init, and this actually made
all the back-button submit workThanks again Eelco

Objects.setObjectStreamFactory(new
IObjectStreamFactory.DefaultObjectStreamFactory());

Joshua
-
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] from 1.2.6 to 1.3.0 snapshot

2007-04-30 Thread D.Alexander
ok, found it: 
http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-datepicker


-Original Message-
From: [EMAIL PROTECTED] on behalf of [EMAIL PROTECTED]
Sent: Mon 4/30/2007 3:52 PM
To: wicket-user@lists.sourceforge.net
Subject: from 1.2.6 to 1.3.0 snapshot
 
Ta, I've just upgraded and prefixed all wicket imports with org.apache.

Only problemo seems to be that

wicket.extensions.markup.html.datepicker.DatePicker

has disappeared.

Any idea where it went?

Derek


-Original Message-
From: [EMAIL PROTECTED] on behalf of Matej Knopp
Sent: Mon 4/30/2007 2:10 PM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
 
hi,

i just want to mentioned that there were a nasty bug in 1.3 nested
form processing that was fixed today, so if you have any issues with
it i suggest you upgrading wicket to see if it helps.

-Matej

On 4/30/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> As for your first question, I think the following is a better approach:
>
>
> public AddressFieldsetPanel(String id, IModel address) {
> super(id, new CompoundPropertyModel(address));
> }
>
> and :
>
> form.add(new AddressFieldsetPanel("billing", new
> PropertyModel(form.getModel(), "billing";
> form.add(new AddressFieldsetPanel("shipping", new
> PropertyModel(form.getModel(), "shipping";
>
> then the wiring of the addresses can be done in the model object itself:
>
> Invoice invoice = new Invoice();
> invoice.setBilling(new Address());
> invoice.setShipping(new Address());
>
> Martijn
>
> On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > imho all he should do is extend a panel, and make sure that panel is 
> > > always inside a form.
> > > there is no need to have a form to group a few fields together.
> >
> > Thanks, that's how I was thinking it should be a Fieldset so to speak. Have 
> > progressed a bit
> > down that route but still have a couple of related questions.
> >
> > Am new to Wicket and trying to learn how to do forms (binding and 
> > validation) the Wicket way.
> > Here's where I'm at so far with a simplistic example I'm using (abbreviated 
> > syntax for clarity):
> >
> > PurchaseOrder {
> >  String customerName
> >  PostalAddress deliveryAddress
> >  PostalAddress invoiceAddress
> > }
> >
> > PostalAddress {
> >  String addressLine
> >  String municipality
> >  String postalCode
> >  String country
> > }
> >
> > PurchaseOrderForm extends Form
> > {
> >public PurchaseOrderForm(String name)
> >{
> >   super(name, new CompoundPropertyModel(new PurchaseOrder()));
> >   add(new RequiredTextField("customerName"));
> >   add(new PostalAddressFieldset("deliveryAddress", new 
> > PostalAddress()));  //  ???
> >   add(new PostalAddressFieldset("invoiceAddress", new 
> > PostalAddress()));   //  ???
> >)
> > }
> >
> > PostalAddressFieldset extends Panel
> > {
> > public PostalAddressFieldset(String id, PostalAddress postalAddress)
> >// ???
> > {
> >   super(id, new CompoundPropertyModel(postalAddress));  // ???
> >   add(new RequiredTextField("addressLine"));
> >   add(new RequiredTextField("municipality"));
> >   add(new RequiredTextField("postalCode"));
> >   add(new RequiredTextField("country"));
> > }
> >
> > Bit I'm not sure about is how to wire up the binding of the nested model 
> > object (PostalAddress)
> > to the nested Fieldset (PostalAddressFieldset), see question marks in 
> > comments above.
> > Have done it like this so far to get it to compile but it is obviously 
> > wrong as I'm
> > interested in the nested PostalAddress objects, not new ones.
> >
> > Second question is whether Wicket provides support for creating unique id's 
> > for elements.
> > My html for the PostalAddressFieldset includes things like:
> >
> > 
> >
> > Obviously this is no good as when I use this component multiple times on a 
> > form, I end up
> > with multiple fields with the same id.
> >
> > Any advice on best practice or pointers to examples that demonstrate these 
> > techniques would be
> > appreciated.
> >
> > Cheers,
> > Derek
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] on behalf of Igor Vaynberg
> > Sent: Sun 4/29/2007 8:19 PM
> > To: wicket-user@lists.sourceforge.net
> > Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
> >
> > imho all he should do is extend a panel, and make sure that panel is always 
> > inside a form.
> >
> > there is no need to have a form to group a few fields together.
> >
> > -igor
> >
> >
> >
> > On 4/29/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> >
> > One note: this is a 1.3 feature so only expect it to work there.
> >
> > What happens with the nested forms is that the buttons stay, and 
> > iirc
> > only the inner form is submitted when a button is pressed inside 
> > that
> > inner form.
> >
> > I think the discussion never got to a conclusion o

[Wicket-user] from 1.2.6 to 1.3.0 snapshot

2007-04-30 Thread D.Alexander
Ta, I've just upgraded and prefixed all wicket imports with org.apache.

Only problemo seems to be that

wicket.extensions.markup.html.datepicker.DatePicker

has disappeared.

Any idea where it went?

Derek


-Original Message-
From: [EMAIL PROTECTED] on behalf of Matej Knopp
Sent: Mon 4/30/2007 2:10 PM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
 
hi,

i just want to mentioned that there were a nasty bug in 1.3 nested
form processing that was fixed today, so if you have any issues with
it i suggest you upgrading wicket to see if it helps.

-Matej

On 4/30/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> As for your first question, I think the following is a better approach:
>
>
> public AddressFieldsetPanel(String id, IModel address) {
> super(id, new CompoundPropertyModel(address));
> }
>
> and :
>
> form.add(new AddressFieldsetPanel("billing", new
> PropertyModel(form.getModel(), "billing";
> form.add(new AddressFieldsetPanel("shipping", new
> PropertyModel(form.getModel(), "shipping";
>
> then the wiring of the addresses can be done in the model object itself:
>
> Invoice invoice = new Invoice();
> invoice.setBilling(new Address());
> invoice.setShipping(new Address());
>
> Martijn
>
> On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > imho all he should do is extend a panel, and make sure that panel is 
> > > always inside a form.
> > > there is no need to have a form to group a few fields together.
> >
> > Thanks, that's how I was thinking it should be a Fieldset so to speak. Have 
> > progressed a bit
> > down that route but still have a couple of related questions.
> >
> > Am new to Wicket and trying to learn how to do forms (binding and 
> > validation) the Wicket way.
> > Here's where I'm at so far with a simplistic example I'm using (abbreviated 
> > syntax for clarity):
> >
> > PurchaseOrder {
> >  String customerName
> >  PostalAddress deliveryAddress
> >  PostalAddress invoiceAddress
> > }
> >
> > PostalAddress {
> >  String addressLine
> >  String municipality
> >  String postalCode
> >  String country
> > }
> >
> > PurchaseOrderForm extends Form
> > {
> >public PurchaseOrderForm(String name)
> >{
> >   super(name, new CompoundPropertyModel(new PurchaseOrder()));
> >   add(new RequiredTextField("customerName"));
> >   add(new PostalAddressFieldset("deliveryAddress", new 
> > PostalAddress()));  //  ???
> >   add(new PostalAddressFieldset("invoiceAddress", new 
> > PostalAddress()));   //  ???
> >)
> > }
> >
> > PostalAddressFieldset extends Panel
> > {
> > public PostalAddressFieldset(String id, PostalAddress postalAddress)
> >// ???
> > {
> >   super(id, new CompoundPropertyModel(postalAddress));  // ???
> >   add(new RequiredTextField("addressLine"));
> >   add(new RequiredTextField("municipality"));
> >   add(new RequiredTextField("postalCode"));
> >   add(new RequiredTextField("country"));
> > }
> >
> > Bit I'm not sure about is how to wire up the binding of the nested model 
> > object (PostalAddress)
> > to the nested Fieldset (PostalAddressFieldset), see question marks in 
> > comments above.
> > Have done it like this so far to get it to compile but it is obviously 
> > wrong as I'm
> > interested in the nested PostalAddress objects, not new ones.
> >
> > Second question is whether Wicket provides support for creating unique id's 
> > for elements.
> > My html for the PostalAddressFieldset includes things like:
> >
> > 
> >
> > Obviously this is no good as when I use this component multiple times on a 
> > form, I end up
> > with multiple fields with the same id.
> >
> > Any advice on best practice or pointers to examples that demonstrate these 
> > techniques would be
> > appreciated.
> >
> > Cheers,
> > Derek
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] on behalf of Igor Vaynberg
> > Sent: Sun 4/29/2007 8:19 PM
> > To: wicket-user@lists.sourceforge.net
> > Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
> >
> > imho all he should do is extend a panel, and make sure that panel is always 
> > inside a form.
> >
> > there is no need to have a form to group a few fields together.
> >
> > -igor
> >
> >
> >
> > On 4/29/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> >
> > One note: this is a 1.3 feature so only expect it to work there.
> >
> > What happens with the nested forms is that the buttons stay, and 
> > iirc
> > only the inner form is submitted when a button is pressed inside 
> > that
> > inner form.
> >
> > I think the discussion never got to a conclusion on what happens 
> > when
> > the outer form is submitted. I think we can still change that 
> > behavior
> > (we're not final or in release candidate mode).
> >
> > FormComponent is for input controls (textfields, buttons,
> > dropdownchoice, etc). Fo

Re: [Wicket-user] Nested Forms and onSubmit()?

2007-04-30 Thread D.Alexander
Ok, but name != id in xhtml and the value of xhtml id attributes on the page 
must be unique 
or it isn't valid.

Do I need to ensure that any custom components do not include an xhtml id 
attribute?

Derek





-Original Message-
From: [EMAIL PROTECTED] on behalf of Martijn Dashorst
Sent: Mon 4/30/2007 1:56 PM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
 
On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Second question is whether Wicket provides support for creating unique id's 
> for elements.
> My html for the PostalAddressFieldset includes things like:
>
> 
>
> Obviously this is no good as when I use this component multiple times on a 
> form, I end up
> with multiple fields with the same id.

Wicket will create unique id's (names) for the form components
automatically, as the panel is a differentiating factor here: it takes
into account the fact that you have the fields on a panel (the wonders
of a true component oriented framework).

Martijn

-- 
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

-
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


* Email confidentiality notice *
This message is private and confidential. If you have received this message in 
error, please notify us and remove it from your system.
 
The London School of Economics and Political Science (the School) is a company 
limited by guarantee, registered in England and Wales, under registered number 
00070527, and having its registered office at 10th Floor, Tower One, Houghton 
Street, London WC2A 2AE.
 
The inclusion of this information does not of itself make this email a business 
document of the School and, to the maximum extent permitted by law, the School 
accepts no liability for the content and opinions in any non-business emails.<>-
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] Nested Forms and onSubmit()?

2007-04-30 Thread D.Alexander
Nice, I thought this should be easy - and it is!

Derek

-Original Message-
From: [EMAIL PROTECTED] on behalf of Martijn Dashorst
Sent: Mon 4/30/2007 2:01 PM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
 
As for your first question, I think the following is a better approach:


public AddressFieldsetPanel(String id, IModel address) {
super(id, new CompoundPropertyModel(address));
}

and :

form.add(new AddressFieldsetPanel("billing", new
PropertyModel(form.getModel(), "billing";
form.add(new AddressFieldsetPanel("shipping", new
PropertyModel(form.getModel(), "shipping";

then the wiring of the addresses can be done in the model object itself:

Invoice invoice = new Invoice();
invoice.setBilling(new Address());
invoice.setShipping(new Address());

Martijn

On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > imho all he should do is extend a panel, and make sure that panel is always 
> > inside a form.
> > there is no need to have a form to group a few fields together.
>
> Thanks, that's how I was thinking it should be a Fieldset so to speak. Have 
> progressed a bit
> down that route but still have a couple of related questions.
>
> Am new to Wicket and trying to learn how to do forms (binding and validation) 
> the Wicket way.
> Here's where I'm at so far with a simplistic example I'm using (abbreviated 
> syntax for clarity):
>
> PurchaseOrder {
>  String customerName
>  PostalAddress deliveryAddress
>  PostalAddress invoiceAddress
> }
>
> PostalAddress {
>  String addressLine
>  String municipality
>  String postalCode
>  String country
> }
>
> PurchaseOrderForm extends Form
> {
>public PurchaseOrderForm(String name)
>{
>   super(name, new CompoundPropertyModel(new PurchaseOrder()));
>   add(new RequiredTextField("customerName"));
>   add(new PostalAddressFieldset("deliveryAddress", new PostalAddress())); 
>  //  ???
>   add(new PostalAddressFieldset("invoiceAddress", new PostalAddress()));  
>  //  ???
>)
> }
>
> PostalAddressFieldset extends Panel
> {
> public PostalAddressFieldset(String id, PostalAddress postalAddress)  
>  // ???
> {
>   super(id, new CompoundPropertyModel(postalAddress));  // ???
>   add(new RequiredTextField("addressLine"));
>   add(new RequiredTextField("municipality"));
>   add(new RequiredTextField("postalCode"));
>   add(new RequiredTextField("country"));
> }
>
> Bit I'm not sure about is how to wire up the binding of the nested model 
> object (PostalAddress)
> to the nested Fieldset (PostalAddressFieldset), see question marks in 
> comments above.
> Have done it like this so far to get it to compile but it is obviously wrong 
> as I'm
> interested in the nested PostalAddress objects, not new ones.
>
> Second question is whether Wicket provides support for creating unique id's 
> for elements.
> My html for the PostalAddressFieldset includes things like:
>
> 
>
> Obviously this is no good as when I use this component multiple times on a 
> form, I end up
> with multiple fields with the same id.
>
> Any advice on best practice or pointers to examples that demonstrate these 
> techniques would be
> appreciated.
>
> Cheers,
> Derek
>
>
>
>
>
>
>
>
>
> -Original Message-
> From: [EMAIL PROTECTED] on behalf of Igor Vaynberg
> Sent: Sun 4/29/2007 8:19 PM
> To: wicket-user@lists.sourceforge.net
> Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
>
> imho all he should do is extend a panel, and make sure that panel is always 
> inside a form.
>
> there is no need to have a form to group a few fields together.
>
> -igor
>
>
>
> On 4/29/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
>
> One note: this is a 1.3 feature so only expect it to work there.
>
> What happens with the nested forms is that the buttons stay, and iirc
> only the inner form is submitted when a button is pressed inside that
> inner form.
>
> I think the discussion never got to a conclusion on what happens when
> the outer form is submitted. I think we can still change that behavior
> (we're not final or in release candidate mode).
>
> FormComponent is for input controls (textfields, buttons,
> dropdownchoice, etc). Forms are for the form tag. So in your case, you
> should extend Form, and Wicket should take care of processing the
> right form (inner, outer, sibling) for you.
>
> But as I said, it probably is still a bit raw currently, as it is a
> new feature and not widely used.
>
> Martijn
>
> On 4/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > > Wicket supports nested forms. The inner form tags are replaced 
> with
> > >  elements. This is a component framework, where you expect 
> forms
> > > to be able to be nested (form on a reusable panel anyone?).
> >
> > I'm just starting to work

Re: [Wicket-user] how to get a form's field when i click on an ajax object

2007-04-30 Thread ChuckDeal


igor.vaynberg wrote:
> 
> if you use wicket validators and the component is invalid the onerror()
> will
> be called instead of onupdate()
> 
> the value is available via getformcomponent().getmodelobject() inside
> onupdate()
> 
> -igor
> 
> On 4/27/07, wicket0123 <[EMAIL PROTECTED]> wrote:
>> I want to use ajax to check if a field value is valid w/o submitting the
>> entire form.  I add AjaxFormComponentUpdatingBehavior to my ajax object
>> (link/button/etc).  But, I don't know how to retrieve the edit field's
>> value
>> inside the onUpdate method.  See the code I have:
>>
>> fc = new RequiredTextField("userName");
>> fc.setLabel(new Model("User Name"));
>> add(fc);
>>
>> fc = new Button("checkId");
>> fc.add(new AjaxFormComponentUpdatingBehavior("onClick") {
>> protected void onUpdate(AjaxRequestTarget target)
>> {
>>
>> System.out.println("This gets called");
>>
>> // TODO: how to get the userName field's
>> value?
>>
>>
>> }
>> });
>>
>> add(fc);
> 


But when you want the event fired as a result of a button click,
formcomponentupdatingbehavior only submits the component it is attached to
(the button).  I had the same problem, so I wrote this behavior that acts
like a formcomponentupdatingbehavior but works like you want it to:

you would still attach it to the button, but you would override the
getComponentsToUpdate() method to return a list of FormComponents that
should be submitted as a result of this event, specifically, your textfield.

Does this work for you?

Chuck

=
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

import wicket.ajax.AjaxEventBehavior;
import wicket.ajax.AjaxRequestTarget;
import wicket.markup.html.form.FormComponent;

public abstract class AjaxMultipleComponentUpdatingBehavior extends
AjaxEventBehavior {
/**
 * Constructor for AjaxMultipleComponentUpdatingBehavior
 * 
 * @param event
 */
public AjaxMultipleComponentUpdatingBehavior(final String event) {
super(event);
}

/**
 * Returns a List of FormComponents that should be updated upon this 
event
 * 
 * @return List
 */
protected abstract List getComponentsToUpdate();

/**
 * If there are any Components to update, then perform an Ajax POST
 * Otherwise, fallback to an Ajax GET
 * 
 * @see wicket.ajax.AjaxEventBehavior#getEventHandler()
 */
protected final CharSequence getEventHandler() {
StringBuffer serialize = new StringBuffer(1024);

Iterator i = getFormComponents().iterator();
FormComponent fc = null;
while (i.hasNext()) {
fc = i.next();

if (!fc.getOutputMarkupId()) {
throw new IllegalArgumentException("cannot 
update component that does
not have setOutputMarkupId property set to true.\n\tComponent: "
+ fc.toString());
}

if (serialize.length() > 0) {
serialize.append(" + ");
}

serialize.append("wicketSerialize(document.getElementById('");
serialize.append(fc.getMarkupId());
serialize.append("'))");
}

if (serialize.length() > 0) {
StringBuffer call = new StringBuffer(1024);
call.append("wicketAjaxPost('");
call.append(getCallbackUrl());
call.append("', ");
call.append(serialize);

return getCallbackScript(call, null, null);
}
else {
return getCallbackScript();
}
}

/**
 * This internal method guarantees that the Behavior can rely on a 
 * non-null, non-empty list for processing.
 * 
 * @return List
 */
private List getFormComponents() {
List list = getComponentsToUpdate();

/*
 * Make a clean copy of the supplied list
 */
if (list != null) {
list = new LinkedList(list);
}
else {
list = new LinkedList();
}

/*
 * Attempt to also update the Component this behavior is 
attached to
 * (Insert the item as the first component to be updated) 
  

Re: [Wicket-user] Nested Forms and onSubmit()?

2007-04-30 Thread Matej Knopp
hi,

i just want to mentioned that there were a nasty bug in 1.3 nested
form processing that was fixed today, so if you have any issues with
it i suggest you upgrading wicket to see if it helps.

-Matej

On 4/30/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> As for your first question, I think the following is a better approach:
>
>
> public AddressFieldsetPanel(String id, IModel address) {
> super(id, new CompoundPropertyModel(address));
> }
>
> and :
>
> form.add(new AddressFieldsetPanel("billing", new
> PropertyModel(form.getModel(), "billing";
> form.add(new AddressFieldsetPanel("shipping", new
> PropertyModel(form.getModel(), "shipping";
>
> then the wiring of the addresses can be done in the model object itself:
>
> Invoice invoice = new Invoice();
> invoice.setBilling(new Address());
> invoice.setShipping(new Address());
>
> Martijn
>
> On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > imho all he should do is extend a panel, and make sure that panel is 
> > > always inside a form.
> > > there is no need to have a form to group a few fields together.
> >
> > Thanks, that's how I was thinking it should be a Fieldset so to speak. Have 
> > progressed a bit
> > down that route but still have a couple of related questions.
> >
> > Am new to Wicket and trying to learn how to do forms (binding and 
> > validation) the Wicket way.
> > Here's where I'm at so far with a simplistic example I'm using (abbreviated 
> > syntax for clarity):
> >
> > PurchaseOrder {
> >  String customerName
> >  PostalAddress deliveryAddress
> >  PostalAddress invoiceAddress
> > }
> >
> > PostalAddress {
> >  String addressLine
> >  String municipality
> >  String postalCode
> >  String country
> > }
> >
> > PurchaseOrderForm extends Form
> > {
> >public PurchaseOrderForm(String name)
> >{
> >   super(name, new CompoundPropertyModel(new PurchaseOrder()));
> >   add(new RequiredTextField("customerName"));
> >   add(new PostalAddressFieldset("deliveryAddress", new 
> > PostalAddress()));  //  ???
> >   add(new PostalAddressFieldset("invoiceAddress", new 
> > PostalAddress()));   //  ???
> >)
> > }
> >
> > PostalAddressFieldset extends Panel
> > {
> > public PostalAddressFieldset(String id, PostalAddress postalAddress)
> >// ???
> > {
> >   super(id, new CompoundPropertyModel(postalAddress));  // ???
> >   add(new RequiredTextField("addressLine"));
> >   add(new RequiredTextField("municipality"));
> >   add(new RequiredTextField("postalCode"));
> >   add(new RequiredTextField("country"));
> > }
> >
> > Bit I'm not sure about is how to wire up the binding of the nested model 
> > object (PostalAddress)
> > to the nested Fieldset (PostalAddressFieldset), see question marks in 
> > comments above.
> > Have done it like this so far to get it to compile but it is obviously 
> > wrong as I'm
> > interested in the nested PostalAddress objects, not new ones.
> >
> > Second question is whether Wicket provides support for creating unique id's 
> > for elements.
> > My html for the PostalAddressFieldset includes things like:
> >
> > 
> >
> > Obviously this is no good as when I use this component multiple times on a 
> > form, I end up
> > with multiple fields with the same id.
> >
> > Any advice on best practice or pointers to examples that demonstrate these 
> > techniques would be
> > appreciated.
> >
> > Cheers,
> > Derek
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] on behalf of Igor Vaynberg
> > Sent: Sun 4/29/2007 8:19 PM
> > To: wicket-user@lists.sourceforge.net
> > Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
> >
> > imho all he should do is extend a panel, and make sure that panel is always 
> > inside a form.
> >
> > there is no need to have a form to group a few fields together.
> >
> > -igor
> >
> >
> >
> > On 4/29/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> >
> > One note: this is a 1.3 feature so only expect it to work there.
> >
> > What happens with the nested forms is that the buttons stay, and 
> > iirc
> > only the inner form is submitted when a button is pressed inside 
> > that
> > inner form.
> >
> > I think the discussion never got to a conclusion on what happens 
> > when
> > the outer form is submitted. I think we can still change that 
> > behavior
> > (we're not final or in release candidate mode).
> >
> > FormComponent is for input controls (textfields, buttons,
> > dropdownchoice, etc). Forms are for the form tag. So in your case, 
> > you
> > should extend Form, and Wicket should take care of processing the
> > right form (inner, outer, sibling) for you.
> >
> > But as I said, it probably is still a bit raw currently, as it is a
> > new feature and not widely used.
> >
> > Martijn
> >
> > On 4/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrot

Re: [Wicket-user] Nested Forms and onSubmit()?

2007-04-30 Thread Martijn Dashorst
As for your first question, I think the following is a better approach:


public AddressFieldsetPanel(String id, IModel address) {
super(id, new CompoundPropertyModel(address));
}

and :

form.add(new AddressFieldsetPanel("billing", new
PropertyModel(form.getModel(), "billing";
form.add(new AddressFieldsetPanel("shipping", new
PropertyModel(form.getModel(), "shipping";

then the wiring of the addresses can be done in the model object itself:

Invoice invoice = new Invoice();
invoice.setBilling(new Address());
invoice.setShipping(new Address());

Martijn

On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > imho all he should do is extend a panel, and make sure that panel is always 
> > inside a form.
> > there is no need to have a form to group a few fields together.
>
> Thanks, that's how I was thinking it should be a Fieldset so to speak. Have 
> progressed a bit
> down that route but still have a couple of related questions.
>
> Am new to Wicket and trying to learn how to do forms (binding and validation) 
> the Wicket way.
> Here's where I'm at so far with a simplistic example I'm using (abbreviated 
> syntax for clarity):
>
> PurchaseOrder {
>  String customerName
>  PostalAddress deliveryAddress
>  PostalAddress invoiceAddress
> }
>
> PostalAddress {
>  String addressLine
>  String municipality
>  String postalCode
>  String country
> }
>
> PurchaseOrderForm extends Form
> {
>public PurchaseOrderForm(String name)
>{
>   super(name, new CompoundPropertyModel(new PurchaseOrder()));
>   add(new RequiredTextField("customerName"));
>   add(new PostalAddressFieldset("deliveryAddress", new PostalAddress())); 
>  //  ???
>   add(new PostalAddressFieldset("invoiceAddress", new PostalAddress()));  
>  //  ???
>)
> }
>
> PostalAddressFieldset extends Panel
> {
> public PostalAddressFieldset(String id, PostalAddress postalAddress)  
>  // ???
> {
>   super(id, new CompoundPropertyModel(postalAddress));  // ???
>   add(new RequiredTextField("addressLine"));
>   add(new RequiredTextField("municipality"));
>   add(new RequiredTextField("postalCode"));
>   add(new RequiredTextField("country"));
> }
>
> Bit I'm not sure about is how to wire up the binding of the nested model 
> object (PostalAddress)
> to the nested Fieldset (PostalAddressFieldset), see question marks in 
> comments above.
> Have done it like this so far to get it to compile but it is obviously wrong 
> as I'm
> interested in the nested PostalAddress objects, not new ones.
>
> Second question is whether Wicket provides support for creating unique id's 
> for elements.
> My html for the PostalAddressFieldset includes things like:
>
> 
>
> Obviously this is no good as when I use this component multiple times on a 
> form, I end up
> with multiple fields with the same id.
>
> Any advice on best practice or pointers to examples that demonstrate these 
> techniques would be
> appreciated.
>
> Cheers,
> Derek
>
>
>
>
>
>
>
>
>
> -Original Message-
> From: [EMAIL PROTECTED] on behalf of Igor Vaynberg
> Sent: Sun 4/29/2007 8:19 PM
> To: wicket-user@lists.sourceforge.net
> Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
>
> imho all he should do is extend a panel, and make sure that panel is always 
> inside a form.
>
> there is no need to have a form to group a few fields together.
>
> -igor
>
>
>
> On 4/29/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
>
> One note: this is a 1.3 feature so only expect it to work there.
>
> What happens with the nested forms is that the buttons stay, and iirc
> only the inner form is submitted when a button is pressed inside that
> inner form.
>
> I think the discussion never got to a conclusion on what happens when
> the outer form is submitted. I think we can still change that behavior
> (we're not final or in release candidate mode).
>
> FormComponent is for input controls (textfields, buttons,
> dropdownchoice, etc). Forms are for the form tag. So in your case, you
> should extend Form, and Wicket should take care of processing the
> right form (inner, outer, sibling) for you.
>
> But as I said, it probably is still a bit raw currently, as it is a
> new feature and not widely used.
>
> Martijn
>
> On 4/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > > Wicket supports nested forms. The inner form tags are replaced 
> with
> > >  elements. This is a component framework, where you expect 
> forms
> > > to be able to be nested (form on a reusable panel anyone?).
> >
> > I'm just starting to work on a similar thing: an address form panel 
> to
> > be used in other forms.
> >
> > Had assumed I should be extending FormComponent rather than Form 
> itself.
> > Are you suggesting otherwise? Or does the nested form's submit 
>

Re: [Wicket-user] Nested Forms and onSubmit()?

2007-04-30 Thread Martijn Dashorst
On 4/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Second question is whether Wicket provides support for creating unique id's 
> for elements.
> My html for the PostalAddressFieldset includes things like:
>
> 
>
> Obviously this is no good as when I use this component multiple times on a 
> form, I end up
> with multiple fields with the same id.

Wicket will create unique id's (names) for the form components
automatically, as the panel is a differentiating factor here: it takes
into account the fact that you have the fields on a panel (the wonders
of a true component oriented framework).

Martijn

-- 
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

-
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] Nested Forms and onSubmit()?

2007-04-30 Thread D.Alexander
> imho all he should do is extend a panel, and make sure that panel is always 
> inside a form.
> there is no need to have a form to group a few fields together.

Thanks, that's how I was thinking it should be a Fieldset so to speak. Have 
progressed a bit 
down that route but still have a couple of related questions.

Am new to Wicket and trying to learn how to do forms (binding and validation) 
the Wicket way. 
Here's where I'm at so far with a simplistic example I'm using (abbreviated 
syntax for clarity):

PurchaseOrder {
 String customerName
 PostalAddress deliveryAddress
 PostalAddress invoiceAddress
}

PostalAddress {
 String addressLine
 String municipality
 String postalCode
 String country
}

PurchaseOrderForm extends Form 
{
   public PurchaseOrderForm(String name) 
   {
  super(name, new CompoundPropertyModel(new PurchaseOrder()));
  add(new RequiredTextField("customerName"));
  add(new PostalAddressFieldset("deliveryAddress", new PostalAddress()));  
//  ???
  add(new PostalAddressFieldset("invoiceAddress", new PostalAddress()));   
//  ???
   )
}

PostalAddressFieldset extends Panel
{
public PostalAddressFieldset(String id, PostalAddress postalAddress)   
// ???
{
  super(id, new CompoundPropertyModel(postalAddress));  // ???
  add(new RequiredTextField("addressLine"));
  add(new RequiredTextField("municipality"));
  add(new RequiredTextField("postalCode"));
  add(new RequiredTextField("country"));
}

Bit I'm not sure about is how to wire up the binding of the nested model object 
(PostalAddress) 
to the nested Fieldset (PostalAddressFieldset), see question marks in comments 
above.
Have done it like this so far to get it to compile but it is obviously wrong as 
I'm 
interested in the nested PostalAddress objects, not new ones.

Second question is whether Wicket provides support for creating unique id's for 
elements.
My html for the PostalAddressFieldset includes things like:

 

Obviously this is no good as when I use this component multiple times on a 
form, I end up 
with multiple fields with the same id.

Any advice on best practice or pointers to examples that demonstrate these 
techniques would be
appreciated.

Cheers,
Derek









-Original Message-
From: [EMAIL PROTECTED] on behalf of Igor Vaynberg
Sent: Sun 4/29/2007 8:19 PM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
 
imho all he should do is extend a panel, and make sure that panel is always 
inside a form.

there is no need to have a form to group a few fields together.

-igor



On 4/29/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:

One note: this is a 1.3 feature so only expect it to work there.

What happens with the nested forms is that the buttons stay, and iirc
only the inner form is submitted when a button is pressed inside that
inner form. 

I think the discussion never got to a conclusion on what happens when
the outer form is submitted. I think we can still change that behavior
(we're not final or in release candidate mode).

FormComponent is for input controls (textfields, buttons, 
dropdownchoice, etc). Forms are for the form tag. So in your case, you
should extend Form, and Wicket should take care of processing the
right form (inner, outer, sibling) for you.

But as I said, it probably is still a bit raw currently, as it is a 
new feature and not widely used.

Martijn

On 4/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> 
> > Wicket supports nested forms. The inner form tags are replaced with
> >  elements. This is a component framework, where you expect 
forms
> > to be able to be nested (form on a reusable panel anyone?). 
>
> I'm just starting to work on a similar thing: an address form panel to
> be used in other forms.
>
> Had assumed I should be extending FormComponent rather than Form 
itself.
> Are you suggesting otherwise? Or does the nested form's submit button 
> get removed too?
>
> Is there an example of this kind of thing? I couldn't find one.
>
> Cheers,
> Derek
>
>
>
> -Original Message-
> From: [EMAIL PROTECTED] on behalf of Martijn Dashorst
> Sent: Fri 4/27/2007 2:37 PM
> To: wicket-user@lists.sourceforge.net 
 
> Subject: Re: [Wicket-user] Nested Forms and onSubmit()?
>
> On 4/27/07, jan_bar <[EMAIL PROTECTED]> wrote:
> > I think that you cannot nest  in HTML. You have to "nest" 
them with 
> > CSS. This will also solve your trouble with form submits - I think 
that the
> > browser simply ignores the nested  tags.
>
> Wicket s

Re: [Wicket-user] Modelling HashSets in a CheckBoxMultipleChoice

2007-04-30 Thread Eelco Hillenius
new ArrayList(yourSet);

Eelco


On 4/30/07, James Perry <[EMAIL PROTECTED]> wrote:
> I am trying to model a hashset in a wicket webpage that allows to edit an
> user's details. I have a hashset of the user's roles however I cannot model
> them using the CheckBoxMultipleChoice component. How can I model this
> hashset so roles can selected and deselected.
>
> Thanks in advance,
>
> - James
>
> -
> 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


[Wicket-user] Modelling HashSets in a CheckBoxMultipleChoice

2007-04-30 Thread James Perry

I am trying to model a hashset in a wicket webpage that allows to edit an
user's details. I have a hashset of the user's roles however I cannot model
them using the CheckBoxMultipleChoice component. How can I model this
hashset so roles can selected and deselected.

Thanks in advance,

- James
-
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] Different JS 'this' object using ajax

2007-04-30 Thread Tauren Mills
Ahh, that makes sense.  I'll give that a try tomorrow. Thanks!

Tauren


On 4/30/07, Matej Knopp <[EMAIL PROTECTED]> wrote:
> Safest solution is to do
> item.setOutputMarkupId(true);;
>
> and then 
> target.appendJavascript("selectRow(document.getElementById('"+item.getMarkuipId()+"')");
>
> -Matej
>
> On 4/29/07, Tauren Mills <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > It appears that the javascript "this" object is different when I
> > hardcode the javascript into the html vs. using an AjaxEventBehavior
> > and appendJavascript.  For instance, the "this" in this refers to the
> > TR which is correct and the selectRow functions works properly:
> >
> > 
> >
> > But if I use this html:
> >
> > 
> >
> > With this code in a DataView:
> >
> > item.add(new AjaxEventBehavior("onClick") {
> > @Override
> > protected void onEvent(AjaxRequestTarget target) {
> > target.appendJavascript("selectRow(this)");
> > }
> > });
> >
> > Then my selectRow() method doesn't work right.  It appears "this" is a
> > different object and not the TR.
> >
> > For reference, here is the javascript, which just highlights the row
> > that has been clicked and removes the highlight from the previously
> > selected row, if any:
> >
> > var lastRow;
> > var lastRowClass;
> >
> > function selectRow(row) {
> > if (lastRow != null) {
> > lastRow.className = lastRowClass;
> > }
> > lastRow = row;
> > lastRowClass = row.className;
> > row.className = "selected";
> > }
> >
> > Any ideas what the "this" object is in the 2nd case, and what I should
> > use instead?
> >
> > Tauren
> >
> > -
> > 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
>

-
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] Different JS 'this' object using ajax

2007-04-30 Thread Matej Knopp
Safest solution is to do
item.setOutputMarkupId(true);;

and then 
target.appendJavascript("selectRow(document.getElementById('"+item.getMarkuipId()+"')");

-Matej

On 4/29/07, Tauren Mills <[EMAIL PROTECTED]> wrote:
> Hi,
>
> It appears that the javascript "this" object is different when I
> hardcode the javascript into the html vs. using an AjaxEventBehavior
> and appendJavascript.  For instance, the "this" in this refers to the
> TR which is correct and the selectRow functions works properly:
>
> 
>
> But if I use this html:
>
> 
>
> With this code in a DataView:
>
> item.add(new AjaxEventBehavior("onClick") {
> @Override
> protected void onEvent(AjaxRequestTarget target) {
> target.appendJavascript("selectRow(this)");
> }
> });
>
> Then my selectRow() method doesn't work right.  It appears "this" is a
> different object and not the TR.
>
> For reference, here is the javascript, which just highlights the row
> that has been clicked and removes the highlight from the previously
> selected row, if any:
>
> var lastRow;
> var lastRowClass;
>
> function selectRow(row) {
> if (lastRow != null) {
> lastRow.className = lastRowClass;
> }
> lastRow = row;
> lastRowClass = row.className;
> row.className = "selected";
> }
>
> Any ideas what the "this" object is in the 2nd case, and what I should
> use instead?
>
> Tauren
>
> -
> 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


Re: [Wicket-user] Way to prevent page versioning for a request in 1.3?

2007-04-30 Thread Matej Knopp
Hi,

at actually looks like the bug. What you can try to do is to enable
versioning on the link. What's the URL the link generates? Does it
contain IUnversionedBehaviorListener? If it does you should have the
AbstractDefaultAjaxBehavior.getCallbackScript called with first
parameter = true.

-Matej

On 4/30/07, jamieballing <[EMAIL PROTECTED]> wrote:
>
> We are currently using the incubating-beta1 release. I was stepping through
> the source in a debugger and I'm not sure older versions of the page are
> preserved in the cache (at least when update by an ajax request). I did a
> simple test:
> * I went to a versioned page
> * clicked an ajax control which updates that page
> * hit my browser back button (which didn't actually go to the server but
> reloaded the locally cached page)
> * clicked on another ajax control on the page
> At this point I got a page expired message.
>
> This raises a couple questions:
> 1) This doesn't sound like the bug you are describing... Is the behavior we
> are observing correct behavior?
> 2) Do we need to do anything to enable or set the size of the page cache?
> 3) Is there a more recent version we should be using than the
> incubating-beta1 snapshot?
>
> Many Thanks,
> Jamie
>
>
> Matej Knopp-2 wrote:
> >
> > This is wrong. Even if page version increments, the ajax links should
> > be valid. There was a bug in wicket 1.3 where the wicket still allowed
> > you to do unversioned ajax requests, but that's should be gone
> > already. Can you please test it with most recent 1.3?
> >
> > -Matej
> >
> > On 4/27/07, jamieballing <[EMAIL PROTECTED]> wrote:
> >>
> >> We are experiencing a problem in our application because we are doing
> >> something out of the ordinary.
> >>
> >> We have an applet on our page which makes a wicket request on behalf of
> >> the
> >> page. The request is a form submit which causes a file upload, but it
> >> doesn't affect the state of the page. When wicket 1.3 processes the
> >> request
> >> and calls getResponsePage() it identifies the response as an instance of
> >> PageRequestTarget which causes the last version in the cache to
> >> increment.
> >>
> >> The applet doesn't do anything with the response from wicket, so the
> >> existing wicket urls on the page all still refer to the old page version.
> >> Therefore, when you click anything (e.g. ajax links) we get a page
> >> expired
> >> because the versioning is out of synch.
> >>
> >> How would you recommend we approach this problem? Is there someway to
> >> tell
> >> wicket in the request not to increment the last page version or tell it
> >> that
> >> we are using a different target type than PageRequestTarget?
> >>
> >> Thanks,
> >> Jamie
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Way-to-prevent-page-versioning-for-a-request-in-1.3--tf3658645.html#a10222425
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> -
> >> 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
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/Way-to-prevent-page-versioning-for-a-request-in-1.3--tf3658645.html#a10248419
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> 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

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.n