paging in wicket

2009-03-10 Thread Douglas Ferguson
I was hunting for docs on how to do paging and discovered this:

http://www.wicketstuff.org/wicket13/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.PagingPage


Also,

Anybody know of any good resources on the topic?


Re: paging in wicket

2009-03-10 Thread Michael Sparer

somehow wicketstuff got problems, but the same examples are also on
wicket-library.com - have a look at the ajax pager
http://www.wicket-library.com/wicket-examples/ajax/pageables.1 ... and
everything should be clear :-)

regards,
michael


Douglas Ferguson-2 wrote:
 
 I was hunting for docs on how to do paging and discovered this:
 
 http://www.wicketstuff.org/wicket13/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.PagingPage
 
 
 Also,
 
 Anybody know of any good resources on the topic?
 
 


-
Michael Sparer
http://techblog.molindo.at
-- 
View this message in context: 
http://www.nabble.com/paging-in-wicket-tp22428753p22429970.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: 5 Days of Wicket

2009-03-10 Thread Korbinian Bachl - privat

Hi Andrew,

first I was a bit curious about another wicket intro(TM) but after 
reading it I was amazed. It is one of the best blog entries for wicket 
starting I've read as it elegantly uses helps like the quickstart and 
then shows how to config it for real world usage.


Only things I miss is:

- as you use Hibernate directly you really should mention databinder 
(databinder.net) somehow, as this spares you much work in that way


- some more words to the image thing, as its IMHO not clear why youre 
doing this for a pastebin-like app


*Thumbs up*,

Korbinian


Andrew Lombardi schrieb:

Hey guys,

Just wanted to let you guys know, that here at Mystic we're doing a 
series of blog posts about Wicket, the basics on setting everything up, 
tests, backend, components, etc.  If you're interested, would definitely 
love your comments (on the blog and mailing list of course).  We're 
definitely in love with how Wicket performs for us in our development 
and strive to use it in our projects when it makes sense.  I'll also be 
giving a talk about Wicket at TSSJS/LV in a week (gah!), so stop by and 
say hello: 
http://javasymposium.techtarget.com/html/frameworks.html#ALombardiWicket


Here's the intro article, showing what each day will cover:

http://www.mysticcoders.com/blog/2009/03/09/5-days-of-wicket/

and here's day 1 of 5 (duh!):

http://www.mysticcoders.com/blog/2009/03/09/5-days-of-wicket-day-1/


and if you have digg / reddit, and wouldn't mind upvoting it:

reddit info:

http://bit.ly/3DS2F
http://bit.ly/CFzVI

digg info:

http://bit.ly/PpLD
http://bit.ly/HM0kl


Cheers!



To our success!

Mystic Coders, LLC | Code Magic | www.mysticcoders.com

ANDREW LOMBARDI | and...@mysticcoders.com
2321 E 4th St. Ste C-128, Santa Ana CA 92705
ofc: 949-528-6480
fax: 714-782-6024
cell: 714-697-8046
linked-in: http://www.linkedin.com/in/andrewlombardi

Eco-Tip: Printing e-mails is usually a waste.


This message is for the named person's use only. You must not, directly 
or indirectly, use,
 disclose, distribute, print, or copy any part of this message if you 
are not the intended recipient.






-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Creating a brandable or white label type of application

2009-03-10 Thread Tauren Mills
Igor,

Thanks!  I was already planning to use Brix for CMS purposes, bud
didn't realize it had multi-site features like this.

Tauren


On Sat, Mar 7, 2009 at 1:14 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 if you are just starting to think about building this you might want
 to consider using brix, or another cms that works well with wicket.

 in case of brix:
 each client would get their own jcr workspaces that you can fill in
 with a template. they are then free to edit their own workspace
 creating pages, uploading images, etc.
 it is trivial in brix to map domains to workspaces
 functionality for your application is then provided using brix tiles
 which users are free to move around their html, a tile is basically
 just a [brix:tile tile:id=foo][/brix:tile] anywhere inside the
 markup.

 if this sounds too out there you can still use normal wicket code and
 allow your customers to edit the markup. you can store the markup
 itself in the database, so all things like styles and variations still
 work even though markup is not in the war. see IMarkupStreamProvider
 and IMarkupCacheKeyProvider - these allow you to override where markup
 comes from per page or per hierarchy of pages. there are more general
 things like IResourceStreamProvider that will allow you to override
 where resources are loaded from on a global scale.

 -igor

 On Fri, Mar 6, 2009 at 7:30 PM, Tauren Mills tau...@groovee.com wrote:
 I'm looking for thoughts on ways to create a site that can be branded
 by a customer.  It should do the following:

 * run in a single webapp deployed in a WAR file
 * multiple host names resolve to this same web app
   domain1.com - myapp.com
   domain2.com -- myapp.com
 * based on the host name, the app selects a skin (color scheme,
 images, maybe even layout changes)
 * users need to be able to alter colors, images, and layout in real
 time, so updating the WAR with new skins isn't possible
 * need to pull alternate CSS content and perhaps HTML markup from a
 database and images from a location outside of the WAR.

 This needs to be kind of like blogger.com, where a user can change
 images and colors, and the application displays their blog that way.
 But in my case, the content on the page primarily remains the same,
 just the way it is presented changes.

 So I'm looking at the localization and style features thinking they
 might help.  But they rely on alternate versions of files to be in the
 WAR.
 http://cwiki.apache.org/WICKET/localization-and-skinning-of-applications.html

 What methods would you recommend to get the current hostname from the 
 request?
 Whould this be best done in the RequestCycle, the Session, or?
 What techniques would be useful for using external CSS, images, and HTML?
 Will getStyle/setStyle even help since the content is external of the WAR?

 I realize that I shouldn't allow users to modify HTML markup that
 contains wicket tags.  That could break things very quickly.

 I'm just starting to think about how to do this, so I'm looking for
 any suggestions to direct me to the right tools for the job.

 Thanks,
 Tauren

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: memcached session store

2009-03-10 Thread Martin Grotzke
On Mon, 2009-03-09 at 17:15 +0100, Martijn Dashorst wrote:
 Non-sticky would be rather bad for Wicket performance/programming model.
 
 The default of wicket is to redirect after an event to a get request
 which renders a buffered response. The buffered response is only
 available on the jvm that handled the original request. 
Probably you are referring to IRequestCycleSettings.renderStrategy set
to REDIRECT_TO_BUFFER. This is a good point to consider, thanx!

 If the
 buffered response is not available, it would require rendering all
 content again, requiring fetching all entities, etc. from the
 database.
I asume you are referring to the REDIRECT_TO_RENDER strategy. With this
entities have to be fetched again, but rendering only should occur once
- in the GET request following the redirect. I asume that it's possible
to reduce redirect-after-post to form submits only, right?

In respect to fetching entities twice during a redirect-after-post, we'd
try to keep the session very lightweight in either way and only store
entity ids therein, so for us this wouldn't make much difference.

Are there other things to consider when using REDIRECT_TO_RENDER in
wicket?

Cheers,
Martin


 
 Martijn
 
 
 On Mon, Mar 9, 2009 at 3:03 PM, Martin Grotzke
 martin.grot...@javakaffee.de wrote:
  On Mon, 2009-03-09 at 13:07 +0100, Martijn Dashorst wrote:
  Starts to sound like a form of premature optimization. If you are new
  to Wicket, why do you want to implement a memcached session store?
  What is the usecase?
  We're starting a new project (the relaunch of a big ecommerce system)
  and want to be able to scale out (just throw in new hardware when
  traffic grows). Additionally we have the requirement of session
  failover, both in standard operations and for deployments.
 
  We're discussing non-sticky vs. sticky sessions here and for non-sticky
  sessions memcached (as caching layer in addition to sessions stored in a
  database) is a good candidate, as you don't replicate the changed
  session to all other nodes, but only to the primary node for this
  session id. This is an important aspect for beeing able to scale out.
 
  Concerning non-sticky/sticky/memcached/whatever we're not decided yet,
  still running in evaluation mode :)
 
  Cheers,
  Martin
 
 
 
  Martijn
 
  On Mon, Mar 9, 2009 at 9:56 AM, Martin Grotzke
  martin.grot...@javakaffee.de wrote:
   On Sun, 2009-03-08 at 16:56 -0700, Victor Igumnov wrote:
   I wrote a memcached session manager store for jetty, that our wicket
   app utilizes. Works well, except I can't open source it,
   since it was created on the company's dime ;-(
   Well, most interesting things are not so simple to realize that one can
   do it in its spare time. But the good point is that we can do such
   interesting things in our job :)
  
  
   Here is my opinion on memcached as a session store.
  
   Memcached will not work well as a wicket session store, due to 1mb
   size limits.
   Good to know, I wasn't aware of this restriction (I still need to read
   more about this for details). So one is forced to handle resources
   eating much memory (e.g. fileupload) not via session, which is the case
   even without this 1 mb  size limit :)
  
   Do you have a case where this limit is important especially for wicket?
  
   You honestly don't want to serialize anything past 100kb
   in size due to performance reasons.
   Right.
  
   That said,  It works best if you
   use memcached as a container httpsessionstore with the wicket
   secondlevelcache diskpagestore. The only thing you need to serialize
   is the last pagemap which should only be 50kb in size max. You still
   get fail over since the last page map is distributed.
   And I have to read about page maps (I'm really new to wicket as you
   see :)). AFAIK page maps store a configurable numer of versioned pages
   for back-button support and versioned pages.
  
  
   One thing you need to be careful with is not referencing anything that
   got stored on disk from your active pagemap, it will spiral into a
   stack overflow.
  
   https://issues.apache.org/jira/browse/WICKET-2138
   Thanx! We would need to setup tests to be sure that this won't happen.
  
   Thanx for your input,
   cheers,
   Martin
  
  
  
  
   -Victor
  
   On Mar 8, 2009, at 3:25 PM, Martijn Dashorst wrote:
  
You can check the TIM integration work from the Terracotta guys. That
should make things easier, and you could even try it out, perhaps
saving a memcached implementation completely :)
   
Martijn
   
On Sun, Mar 8, 2009 at 11:01 PM, Martin Grotzke
martin.grot...@javakaffee.de wrote:
Hi,
   
we're just thinking about a session store using memcached. I just
want
to ask if somebody already implemented this (and wants to share)
before
we implement this.
   
Btw, is there some documentation about ISessionStore semantics, in
addition to javadocs? I would be interested in the order in which the

Re: memcached session store

2009-03-10 Thread Martin Grotzke
On Mon, 2009-03-09 at 22:54 -0700, Victor Igumnov wrote:
 Even if you have the memcached store in place, wicket still requires  
 session affinity. Wicket buffers redirect responses locally so the  
 client needs to go to the same server twice or the client will receive  
 an expired session. Wicket is a stateful framework, session affinity  
 is a must.
Are there other things (besides the buffered response when doing a
redirect-after-post with the REDIRECT_TO_BUFFER setting) that require
sticky sessions?

We'd like to use wicket in a stateless mode and defer session creation
as long as it's possible for a user. Even if wicket is made with a
statefull programming model in mind we think there are still many
advantages over other (non-component-based) frameworks. Also we need a
dynamic structure which would be rather hard to realize/simulate with
some other component oriented frameworks ;)

Cheers,
Martin


 
 
 On Mar 9, 2009, at 7:03 AM, Martin Grotzke wrote:
 
  On Mon, 2009-03-09 at 13:07 +0100, Martijn Dashorst wrote:
  Starts to sound like a form of premature optimization. If you are new
  to Wicket, why do you want to implement a memcached session store?
  What is the usecase?
  We're starting a new project (the relaunch of a big ecommerce system)
  and want to be able to scale out (just throw in new hardware when
  traffic grows). Additionally we have the requirement of session
  failover, both in standard operations and for deployments.
 
  We're discussing non-sticky vs. sticky sessions here and for non- 
  sticky
  sessions memcached (as caching layer in addition to sessions stored  
  in a
  database) is a good candidate, as you don't replicate the changed
  session to all other nodes, but only to the primary node for this
  session id. This is an important aspect for beeing able to scale out.
 
  Concerning non-sticky/sticky/memcached/whatever we're not decided yet,
  still running in evaluation mode :)
 
  Cheers,
  Martin
 
 
 
  Martijn
 
  On Mon, Mar 9, 2009 at 9:56 AM, Martin Grotzke
  martin.grot...@javakaffee.de wrote:
  On Sun, 2009-03-08 at 16:56 -0700, Victor Igumnov wrote:
  I wrote a memcached session manager store for jetty, that our  
  wicket
  app utilizes. Works well, except I can't open source it,
  since it was created on the company's dime ;-(
  Well, most interesting things are not so simple to realize that  
  one can
  do it in its spare time. But the good point is that we can do such
  interesting things in our job :)
 
 
  Here is my opinion on memcached as a session store.
 
  Memcached will not work well as a wicket session store, due to 1mb
  size limits.
  Good to know, I wasn't aware of this restriction (I still need to  
  read
  more about this for details). So one is forced to handle resources
  eating much memory (e.g. fileupload) not via session, which is the  
  case
  even without this 1 mb  size limit :)
 
  Do you have a case where this limit is important especially for  
  wicket?
 
  You honestly don't want to serialize anything past 100kb
  in size due to performance reasons.
  Right.
 
  That said,  It works best if you
  use memcached as a container httpsessionstore with the wicket
  secondlevelcache diskpagestore. The only thing you need to  
  serialize
  is the last pagemap which should only be 50kb in size max. You  
  still
  get fail over since the last page map is distributed.
  And I have to read about page maps (I'm really new to wicket as you
  see :)). AFAIK page maps store a configurable numer of versioned  
  pages
  for back-button support and versioned pages.
 
 
  One thing you need to be careful with is not referencing anything  
  that
  got stored on disk from your active pagemap, it will spiral into a
  stack overflow.
 
  https://issues.apache.org/jira/browse/WICKET-2138
  Thanx! We would need to setup tests to be sure that this won't  
  happen.
 
  Thanx for your input,
  cheers,
  Martin
 
 
 
 
  -Victor
 
  On Mar 8, 2009, at 3:25 PM, Martijn Dashorst wrote:
 
  You can check the TIM integration work from the Terracotta guys.  
  That
  should make things easier, and you could even try it out, perhaps
  saving a memcached implementation completely :)
 
  Martijn
 
  On Sun, Mar 8, 2009 at 11:01 PM, Martin Grotzke
  martin.grot...@javakaffee.de wrote:
  Hi,
 
  we're just thinking about a session store using memcached. I just
  want
  to ask if somebody already implemented this (and wants to share)
  before
  we implement this.
 
  Btw, is there some documentation about ISessionStore semantics,  
  in
  addition to javadocs? I would be interested in the order in  
  which the
  different methods would be invoked.
 
  Thanx  cheers,
  Martin
 
 
 
 
 
  --
  Become a Wicket expert, learn from the best: http://wicketinaction.com
  Apache Wicket 1.3.5 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
 
  -
  To unsubscribe, e-mail: 

Re: openstreetmap in openlayers

2009-03-10 Thread nino martinez wael
Seems you are on the right track, unfortunately im pretty busy for the time
being, new job + an daugther.. The idea for the wicket-openlayers.js are to
be a integrator between Openlayers.js and wicket so that it provides
facilities to call the wicket ajax back and forth etc. Thats it.. :)

regards Nino

2009/3/7 morbo richard.wiesin...@gmail.com


 I have to correct myself a little bit. The setCenter method does work! I
 had
 a problem with the coordinates, which were not in the right format. So,
 sorry for that.





 morbo wrote:
 
  Hi Nino,
 
  yes, I would love to contribute to this project. But I'm warning you, I
 am
  not a very experienced javascript developer. :)
 
  What I have done so far, was extending the layer class for all osm
 layers.
  For example I created a OSMMapnik class which contributes
  http://www.openstreetmap.org/openlayers/OpenStreetMap.js; to the header
  and the getJSConstructer method returns this: return new
  Constructor(OpenLayers.Layer.OSM.Mapnik).add(' + getName() +
  ').toJS();
 
  As you see, I am using the OSM object. This solution works but I think it
  would be nicer to use the TSM object, as I have done in my first attempt
  (see above). The problem is that the script does not find the
  osm_getTileURL method. I am not sure why.
 
  Furthermore I modified the setZoom method so, that it calls
  zoomTo(zoom). Thats all.
 
  Maybe, you could give a brief introduction how the project works. I am
 not
  sure if I understand all of your code. Especially the role of the
  wicket-openlayers.js file and event handling.
 
  richard
 
 
 
 
  nino martinez wael wrote:
 
  Hi Richard
 
  Im the author behind the openlayers contrib, I checked the code last
 time
  somewhere in end if december...
 
  Do you have some patches or further clues on whats not working?
 
 
  Im not directly using the openlayers integration currently so patches
 are
  very welcome, even co- coders would be nice :)
  regards Nino
 
  2009/3/6 morbo richard.wiesin...@gmail.com
 
 
  Thank you very much. That really helped a lot. I am now able to render
  the
  different openstreetmap layers (mapnik, ti...@home, cycleMap) with the
  above
  mentioned OpenLayers.Layer.OSM object.
 
  But there still exist some problems. It is not entirely possible to
 edit
  the
  maps with the wicketstuff project. Once the map is rendered there is no
  problem: dragging, zooming, layerswitching are working. But before
  rendering
  not all functions are working. For example the setCenter(lonlat, zoom)
  function of the wicketstuff openlayers contrib seems to do nothing with
  the
  map. Also the setZoom function did not worked at the beginning, but
  after
  some changes I got it working.
 
  I think the project is not entirely up to date with the openlayers api?
  Maybe a user who is more familiar with this project could give a
  statement
  about the problem.
 
 
 
 
 
  Michael O'Cleirigh wrote:
  
   Hello,
  
   Pink tiles means there is a mismatch somewhere between your layers.
  
   Does your openlayers javascript work correctly? (i.e. when not
 emitted
   from wicket openlayers?)
  
   This page embeds an openstreet map in openlayers:
   http://wiki.openstreetmap.org/wiki/OpenLayers
  
   But it doesn't use the OpenLayers.Layer.TMS object. It adds its own
   import (http://openstreetmap.org/openlayers/OpenStreetMap.js ) and
  uses
   an OpenLayers.Layer.OSM object.
  
   Perhaps your integration should use that instead?
  
   There is a ticket for something similiar that might get into
  OpenLayers
   2.8 (http://trac.openlayers.org/ticket/1950)
  
   Mike
  
   I tried a few things and I think I managed the integration of
   openstreetmaps.
   The browser is contacting the osm tile server BUT everything I get
  are
   pink
   tiles?
  
  
   Here is the output of the final html page:
  
   html
   head
   titleWicket Quickstart Archetype Homepage/title
   script type=text/javascript
  
 
 src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script
   script type=text/javascript
  
 
 src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js/script
   script type=text/javascript
  
 
 src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js/script
   script type=text/javascript
   id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/
   wicketAjaxDebugEnable=true;
   /*--]]*//script
  
   script type=text/javascript
   src=http://openlayers.org/api/OpenLayers.js;/script
  
   script type=text/javascript
  
 
 src=resources/org.wicketstuff.openlayers.OpenLayersMap/wicket-openlayersmap.js/script
   script type=text/javascript !--/*--![CDATA[/*!--*/
   Wicket.Event.add(window, load, function(event) { function
   osm_getTileURL(bounds) {var res = this.map.getResolution();var x =
   Math.round((bounds.left - this.maxExtent.left) / (res *
   this.tileSize.w));var y = Math.round((this.maxExtent.top -
  bounds.top) /
   (res * 

Re: openstreetmap in openlayers

2009-03-10 Thread nino martinez wael
Next step for you would be to ask about permission on wicketstuff so you can
commit some of the changes you've done...

2009/3/10 nino martinez wael nino.martinez.w...@gmail.com

 Seems you are on the right track, unfortunately im pretty busy for the time
 being, new job + an daugther.. The idea for the wicket-openlayers.js are to
 be a integrator between Openlayers.js and wicket so that it provides
 facilities to call the wicket ajax back and forth etc. Thats it.. :)

 regards Nino

 2009/3/7 morbo richard.wiesin...@gmail.com


 I have to correct myself a little bit. The setCenter method does work! I
 had
 a problem with the coordinates, which were not in the right format. So,
 sorry for that.





 morbo wrote:
 
  Hi Nino,
 
  yes, I would love to contribute to this project. But I'm warning you, I
 am
  not a very experienced javascript developer. :)
 
  What I have done so far, was extending the layer class for all osm
 layers.
  For example I created a OSMMapnik class which contributes
  http://www.openstreetmap.org/openlayers/OpenStreetMap.js; to the
 header
  and the getJSConstructer method returns this: return new
  Constructor(OpenLayers.Layer.OSM.Mapnik).add(' + getName() +
  ').toJS();
 
  As you see, I am using the OSM object. This solution works but I think
 it
  would be nicer to use the TSM object, as I have done in my first attempt
  (see above). The problem is that the script does not find the
  osm_getTileURL method. I am not sure why.
 
  Furthermore I modified the setZoom method so, that it calls
  zoomTo(zoom). Thats all.
 
  Maybe, you could give a brief introduction how the project works. I am
 not
  sure if I understand all of your code. Especially the role of the
  wicket-openlayers.js file and event handling.
 
  richard
 
 
 
 
  nino martinez wael wrote:
 
  Hi Richard
 
  Im the author behind the openlayers contrib, I checked the code last
 time
  somewhere in end if december...
 
  Do you have some patches or further clues on whats not working?
 
 
  Im not directly using the openlayers integration currently so patches
 are
  very welcome, even co- coders would be nice :)
  regards Nino
 
  2009/3/6 morbo richard.wiesin...@gmail.com
 
 
  Thank you very much. That really helped a lot. I am now able to render
  the
  different openstreetmap layers (mapnik, ti...@home, cycleMap) with
 the
  above
  mentioned OpenLayers.Layer.OSM object.
 
  But there still exist some problems. It is not entirely possible to
 edit
  the
  maps with the wicketstuff project. Once the map is rendered there is
 no
  problem: dragging, zooming, layerswitching are working. But before
  rendering
  not all functions are working. For example the setCenter(lonlat, zoom)
  function of the wicketstuff openlayers contrib seems to do nothing
 with
  the
  map. Also the setZoom function did not worked at the beginning, but
  after
  some changes I got it working.
 
  I think the project is not entirely up to date with the openlayers
 api?
  Maybe a user who is more familiar with this project could give a
  statement
  about the problem.
 
 
 
 
 
  Michael O'Cleirigh wrote:
  
   Hello,
  
   Pink tiles means there is a mismatch somewhere between your layers.
  
   Does your openlayers javascript work correctly? (i.e. when not
 emitted
   from wicket openlayers?)
  
   This page embeds an openstreet map in openlayers:
   http://wiki.openstreetmap.org/wiki/OpenLayers
  
   But it doesn't use the OpenLayers.Layer.TMS object. It adds its own
   import (http://openstreetmap.org/openlayers/OpenStreetMap.js ) and
  uses
   an OpenLayers.Layer.OSM object.
  
   Perhaps your integration should use that instead?
  
   There is a ticket for something similiar that might get into
  OpenLayers
   2.8 (http://trac.openlayers.org/ticket/1950)
  
   Mike
  
   I tried a few things and I think I managed the integration of
   openstreetmaps.
   The browser is contacting the osm tile server BUT everything I get
  are
   pink
   tiles?
  
  
   Here is the output of the final html page:
  
   html
   head
   titleWicket Quickstart Archetype Homepage/title
   script type=text/javascript
  
 
 src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script
   script type=text/javascript
  
 
 src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js/script
   script type=text/javascript
  
 
 src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js/script
   script type=text/javascript
   id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/
   wicketAjaxDebugEnable=true;
   /*--]]*//script
  
   script type=text/javascript
   src=http://openlayers.org/api/OpenLayers.js;/script
  
   script type=text/javascript
  
 
 src=resources/org.wicketstuff.openlayers.OpenLayersMap/wicket-openlayersmap.js/script
   script type=text/javascript !--/*--![CDATA[/*!--*/
   Wicket.Event.add(window, load, function(event) { function
   osm_getTileURL(bounds) {var res = 

test page rendering

2009-03-10 Thread Swanthe Lindgren

Hi all
I have begun unit testing my wicket pages and one of the most basic 
tests I want to do is to make sure each and every page can render 
properly. The WicketTester.assertRenderedPage() looks like a good 
approach but it doesnt seam to care about the HTML. If I remove a 
wicket:id from the markupfile, the test is still passed.

Is this correct or might there be something else I have done wrong?

//Swanthe




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: validation message-keys differences on m3 to rc2

2009-03-10 Thread gilberthuph

I'm having exactly the same problem after moving from 1.4-rc1 - 1.4-rc2

Here's the extract from my properties file TaxiBookingPage.xml.

?xml version=1.0 encoding=UTF-8?
!DOCTYPE properties SYSTEM http://java.sun.com/dtd/properties.dtd;
properties
entry key=generalDetails.numberOfVehiclesRequired.RequiredYou must
enter the number of vehicles/entry
.. snip ..
/properties

RC1

The key generalDetails.numberOfVehiclesRequired.Required is found
immediately and the appropriate message retrieved.

11:00:38.595 [http-8180-3] DEBUG org.apache.wicket.Session - Getting
page [path = 4:taxiBookingForm, versionNumber = 0]
11:00:38.609 [http-8180-3] DEBUG
org.apache.wicket.resource.loader.ComponentStringResourceLoader - Found
resource from: com/rp/webapp/taxi/TaxiBookingPage.; key:
generalDetails.numberOfVehiclesRequired.Required


RC2

Does not attempt to look up
generalDetails.numberOfVehiclesRequired.Required but the key
taxiBookingForm.numberOfVehiclesContainer.numberOfVehiclesRequiredBorder.generalDetails.numberOfVehiclesRequired.Required
which is not found.

10:47:47.902 [http-8180-1] DEBUG org.apache.wicket.Localizer - Locate
property: key: 'Required'; Component: '[MarkupContainer [Component id =
generalDetails.numberOfVehiclesRequired]]'
10:47:47.903 [http-8180-1] DEBUG
org.apache.wicket.resource.loader.ComponentStringResourceLoader - component:
'[MarkupContainer [Component id =
generalDetails.numberOfVehiclesRequired]]'; key: 'Required'
10:47:47.903 [http-8180-1] DEBUG
org.apache.wicket.resource.loader.ComponentStringResourceLoader - key:
'taxiBookingForm.numberOfVehiclesContainer.numberOfVehiclesRequiredBorder.generalDetails.numberOfVehiclesRequired.Required';
class: 'com.rp.webapp.taxi.TaxiBookingPage'; locale: 'en_GB'; Style: 'null'
10:47:47.903 [http-8180-1] DEBUG
org.apache.wicket.resource.loader.ComponentStringResourceLoader - Found
properties file: 'com/rp/webapp/taxi/TaxiBookingPage.' but it doesn't
contain the property

So it seems the lookup algorithm hasn't changed but the message key.

Is this a bug or should we now be using the full form-relative key as shown
above?



Alexander Lohse wrote:
 
 I could not find any reported changes concerning validation message  
 keys from version 1.4-m3 to 1.4-rc2, but I have the following  
 required key in my application resources that does not work anymore.
 .. trim ..
 

-- 
View this message in context: 
http://www.nabble.com/validation-message-keys-differences-on-m3-to-rc2-tp22155986p22431244.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Portlets - Loosing state in wicket portlets

2009-03-10 Thread Benjamin Ernst
Hi,

I am using two Wicket-Portlets in a Liferay 5.2.1 Portal. Both Portlets have
a link which switches to another page within the portlet (via
setResponsepage(new
Page()) ).
When I click the link in Portlet_1 the page within the portlet one changes
as desired. After that I click the link in Portlet_2 and the page in
Portlet_2 changes as desired, but i Portlet_1 the page changes to the
Homepage.

I think that the problem might be in the getWicketURL(PortletRequest
request, String pageType, String defaultPage) - method form
WicketPortlet.java:

protected String getWicketURL(PortletRequest request, String pageType,
String defaultPage)
{
String wicketURL = null;
// get the name of the wicket url paramater, as looked up from a
request attribute called
// WicketPortlet#WICKET_URL_PORTLET_PARAMETER_ATTR
String wicketUrlParameterName =
(String)request.getAttribute(WicketPortlet.WICKET_URL_PORTLET_PARAMETER_ATTR);
if (request instanceof ActionRequest)
{
// try to lookup the passed in wicket url parameter
wicketURL = request.getParameter(wicketUrlParameterName);
}
else if (request instanceof ResourceRequest)
{
wicketURL = ((ResourceRequest)request).getResourceID();
}
else
{
// try to lookup the passed in wicket url parameter, suffixed
with the portlet mode
String parameterName = wicketUrlParameterName +
request.getPortletMode().toString();
wicketURL = request.getParameter(parameterName);
}

// if the wicketURL could not be retrieved, return the url for the
default page
if (wicketURL == null)
{
wicketURL = getWicketConfigParameter(request,
CONFIG_PARAM_PREFIX + pageType,
defaultPage);
}
return wicketURL;
}

 - In the RenderRequest for Portlet_2 the wicketUrlParameterName is for the
Linklistener that was clicked. This works fine.
 - In the RenderRequest for Portlet_1 the wicketUrlParameterName is null. So
by default the defaultPage of Portlet_1 is loaded, which is the Homepage.

Is this the correct behaviour?
I think the wicketURL for the RenderRequest for Portlet_1 should not be the
defaultPage but instead the last rendered Page from Portlet_1. Is there a
way to get the URL of the last page from Wicket?

Thanks for any help!

--Benjamin


RE: test page rendering

2009-03-10 Thread Jeremy Thomerson
Yes - it simply makes sure THAT page rendered. Removing the wicket:id doesn't 
make the page fail to render.  However, try the inverse of that - remove the 
component from the java and it will fail.

Jeremy Thomerson
http://www.wickettraining.com
-- sent from a wireless device


-Original Message-
From: Swanthe Lindgren swanthe.lindg...@megasol.se
Sent: Tuesday, March 10, 2009 5:12 AM
To: users@wicket.apache.org
Subject: test page rendering

Hi all
I have begun unit testing my wicket pages and one of the most basic 
tests I want to do is to make sure each and every page can render 
properly. The WicketTester.assertRenderedPage() looks like a good 
approach but it doesnt seam to care about the HTML. If I remove a 
wicket:id from the markupfile, the test is still passed.
Is this correct or might there be something else I have done wrong?

//Swanthe




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Future of WicketObjectStreamFactory

2009-03-10 Thread Johan Compagner
that one will be depricated/removed in the further
It is to hard to do it on our own and supporting new features of newer
platforms (java 6/7) when we are still on java 4/5

the problems you have should be fixed differently

On Tue, Mar 10, 2009 at 06:15, David Leangen wic...@leangen.net wrote:


 Hi,

 Just wondering about WicketObjectStreamFactory.

 For a reason that I have not yet been able to determine, I am having
 deserialization problems when using the default serialization.

 However, if I set this:

  setObjectStreamFactory(new WicketObjectStreamFactory());

 then my problems go away.

 I have seen on the list that people have the opposite problem, so I'm a
 bit baffled...


 Anyway, is it safe to continue using WicketOSF?

 (Currently using Wicket 1.3.4)

 Thanks!
 =dml




 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: What IDE best fits with Wicket?

2009-03-10 Thread francisco treacy
i would like to add an ingredient here: scala.

is there anyone successfully using an IDE with wicket/maven/scala
*and* jetty hotswap?

i have always developed wicket/java in eclipse (dead easy to set up -
create quickstart archetype, right click debug Start.java and off you
go). but scala plugin for eclipse was a PIA to work with (stable or
nightly) and i decided to try with netbeans 6.5, where scala plugin is
quite decent. i managed to set up the quickstart with maven, added
some config for scala and all is great... but i really can't figure
out how to have jetty hotswap support.  apparently i should add some
configuration to tell netbeans i want the process-resources goal to
execute each time i save an html file, or compile a scala file.

it is not very convenient to restart the app every time i make a
change.  does anybody have experience with a similar setup?

thanks,

francisco


On Sat, Feb 28, 2009 at 5:45 AM, Brill Pappin br...@pappin.ca wrote:
 It's been a year or two since I tried it... but I couldn't stand it
 unfortunately (m4eclipse was going through some serious issues at the time).

 Glad to see that its improved enough to use!

 - Brill

 On 27-Feb-09, at 6:14 AM, Sergio García wrote:


 I'm using Q4E, and although it has some flaws, it works very good with
 maven

 Brill Pappin wrote:

 What are you using instead?

 - Brill

 On 24-Feb-09, at 12:45 PM, James Carman wrote:

 +1!  We had an awful lot of trouble getting it to work for us.

 On Tue, Feb 24, 2009 at 12:38 PM, Martijn Dashorst
 martijn.dasho...@gmail.com wrote:

 m2eclipse is absolutely worthless for anything beyond a quickstart.
 It
 is constantly reparsing poms, grinding eclipse to a halt. It failed
 to
 generate the right project dependencies for our multimodule project
 that consists of 2 multimodule child projects. It failed miserably to
 uninstall, needing me to axe my eclipse installation.

 In short: my experience (and that of my co-workers) with m2eclipse is
 that it is far from ready for prime time.

 Martijn

 On Tue, Feb 24, 2009 at 5:55 PM, Brill Pappin br...@pappin.ca
 wrote:

 I should add something about the Eclipse maven plugins... don't go
 for the
 official eclipse Q4 plugin... use the Maven Integration 4
 Eclipse plugin
 (and actually the development version if your jiggy with it, it
 works and
 gets updated/fixed way more often).

 If your on Netbeans, I think Maven will generate Netbeans project
 files for
 you as well (it will do so for eclipse), so you could actually
 flip back and
 forth if you wanted.

 - Brill Pappin

 On 23-Feb-09, at 5:19 PM, Pierre Goupil wrote:

 +1, I like Wicket Bench. And with M2Eclipse, you have the full
 sources 
 JavaDoc just by adding Wicket as a dependency, which is very
 convenient.
 But
 don't expect Wicket Bench to do too much, it's just a small,
 useful tool.

 Pierre


 Hi, I use Eclipse with Wicket Bench plugin and it works very fine.

 --
 Sans amis était le grand maître des mondes,
 Eprouvait manque, ce pour quoi il créa les esprits,
 Miroirs bienveillants de sa béatitude.
 Mais au vrai, il ne trouva aucun égal,
 Du calice du royaume total des âmes
 Ecume jusqu'à lui l'infinité.

 (Schiller, l'amitié)


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





 --
 Become a Wicket expert, learn from the best: http://
 wicketinaction.com
 Apache Wicket 1.3.5 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




 --
 View this message in context:
 http://www.nabble.com/What-IDE-best-fits-with-Wicket--tp22168133p22243831.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



AW: Tabbed Panel with bookmarkable links

2009-03-10 Thread Christian Helmbold

 Since others seem to need it, this might be worth refining over on 
 wicket-stuff.

I think it's worth to build a universal bookmarkable tabbed panel. Brill, 
please post your solution so we can look what is better in your or in my 
solution and built the ultimative BookmarkableTabbedPanel.

I refined my first version a bit and added the following features:
* Reliable handling of user input (tab number).
* Possibility to mix bookmarkable and stateful links.
* Parameter name to distinguish tabs is now the component id by default. This 
will avoid conflicts with multiple BookmarkableTabbedPanels.

But I'm not sure if mixing bookmarkable and stateful links is a good idea.

Current version:
---
package com.helmbold.wicket.components;

import java.util.ArrayList;
import java.util.List;
import org.apache.wicket.PageParameters;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.extensions.markup.html.tabs.TabbedPanel;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.link..BookmarkablePageLink;


public class BookmarkableTabbedPanel extends TabbedPanel
{

private PageParameters pageParameters;
private String tabParameterName;
private int defaultTabIndex = 0;
  private List unbookmarkableTabIndex = new ArrayList();


  /**
   * Using this constructor the following defaults take effect:
   * ul
   *litabParameterName = component id/li
   *lidefaultTabIndex = 0/li
   * /ul
 * @param id component id
 * @param tabs list of ITab objects used to represent tabs
   * @param pageParameters Container for parameters to a requested page. A
   * parameter for the selected tab will be inserted.
 */
  public BookmarkableTabbedPanel(
  String id,
  ListITab tabs,
  PageParameters pageParameters)
  {
super(id, tabs);
this.pageParameters = pageParameters;
this.tabParameterName = id;

if (pageParameters.containsKey(tabParameterName))
{
  String tab = pageParameters.getString(tabParameterName);
  try
  {
setSelectedTab(Integer.parseInt(tab));
  }
  catch (NumberFormatException e)
  {
setSelectedTab(defaultTabIndex);
  }
}
else
  setSelectedTab(defaultTabIndex);
  }


/**
 * @param id component id
 * @param tabs list of ITab objects used to represent tabs
 * @param defaultTabIndex Set the tab to by displayed by default. The url
 * for this tab will not contain any tab specific information. If you want 
to 
 * display the first tab by default, you can use the constructor without 
this 
 * parameter.
   * @param pageParameters Container for parameters to a requested page. A
   * parameter for the selected tab will be inserted.
 */
public BookmarkableTabbedPanel(
String id, 
ListITab tabs,
int defaultTabIndex,
String tabParameterName,
PageParameters pageParameters,
int ...unbookmarkableTabIndex) 
{
this(id, tabs, pageParameters);
this.defaultTabIndex = defaultTabIndex;
setSelectedTab(defaultTabIndex);
this.tabParameterName = tabParameterName;
for(int element : unbookmarkableTabIndex)
  this.unbookmarkableTabIndex.add(element);
}


@Override
  protected WebMarkupContainer newLink(String linkId, int index)
  {
WebMarkupContainer link;

// create default (not bookmarkable) links for the specified tabs.
if (unbookmarkableTabIndex.contains(index))
  link = super.newLink(linkId, index);
// create bookmarkable links
else
{
  if (index == defaultTabIndex)
pageParameters.remove(tabParameterName);
  else
pageParameters.put(tabParameterName,  + index);
  link = new BookmarkablePageLink(
  linkId, getPage().getClass(), pageParameters);
}

if (index == getSelectedTab())
  link.setEnabled(false);

return link;
  }
  
}
---






-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Tabbed Panel with bookmarkable links

2009-03-10 Thread James Carman
What if you use two different tabbed panels on the same page?

On Tue, Mar 10, 2009 at 8:27 AM, Christian Helmbold
christian.helmb...@yahoo.de wrote:

 Since others seem to need it, this might be worth refining over on 
 wicket-stuff.

 I think it's worth to build a universal bookmarkable tabbed panel. Brill, 
 please post your solution so we can look what is better in your or in my 
 solution and built the ultimative BookmarkableTabbedPanel.

 I refined my first version a bit and added the following features:
 * Reliable handling of user input (tab number).
 * Possibility to mix bookmarkable and stateful links.
 * Parameter name to distinguish tabs is now the component id by default. This 
 will avoid conflicts with multiple BookmarkableTabbedPanels.

 But I'm not sure if mixing bookmarkable and stateful links is a good idea.

 Current version:
 ---
 package com.helmbold.wicket.components;

 import java.util.ArrayList;
 import java.util.List;
 import org.apache.wicket.PageParameters;
 import org.apache.wicket.extensions.markup.html.tabs.ITab;
 import org.apache.wicket.extensions.markup.html.tabs.TabbedPanel;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.link..BookmarkablePageLink;


 public class BookmarkableTabbedPanel extends TabbedPanel
 {

    private PageParameters pageParameters;
    private String tabParameterName;
    private int defaultTabIndex = 0;
  private List unbookmarkableTabIndex = new ArrayList();


  /**
   * Using this constructor the following defaults take effect:
   * ul
   *    litabParameterName = component id/li
   *    lidefaultTabIndex = 0/li
   * /ul
     * @param id component id
     * @param tabs list of ITab objects used to represent tabs
   * @param pageParameters Container for parameters to a requested page. A
   * parameter for the selected tab will be inserted.
     */
  public BookmarkableTabbedPanel(
          String id,
          ListITab tabs,
          PageParameters pageParameters)
  {
    super(id, tabs);
    this.pageParameters = pageParameters;
    this.tabParameterName = id;

    if (pageParameters.containsKey(tabParameterName))
    {
      String tab = pageParameters.getString(tabParameterName);
      try
      {
        setSelectedTab(Integer.parseInt(tab));
      }
      catch (NumberFormatException e)
      {
        setSelectedTab(defaultTabIndex);
      }
    }
    else
      setSelectedTab(defaultTabIndex);
  }


    /**
     * @param id component id
     * @param tabs list of ITab objects used to represent tabs
     * @param defaultTabIndex Set the tab to by displayed by default. The url
     * for this tab will not contain any tab specific information. If you want 
 to
     * display the first tab by default, you can use the constructor without 
 this
     * parameter.
   * @param pageParameters Container for parameters to a requested page. A
   * parameter for the selected tab will be inserted.
     */
    public BookmarkableTabbedPanel(
        String id,
        ListITab tabs,
        int defaultTabIndex,
        String tabParameterName,
    PageParameters pageParameters,
    int ...unbookmarkableTabIndex)
    {
        this(id, tabs, pageParameters);
        this.defaultTabIndex = defaultTabIndex;
        setSelectedTab(defaultTabIndex);
        this.tabParameterName = tabParameterName;
    for(int element : unbookmarkableTabIndex)
      this.unbookmarkableTabIndex.add(element);
    }


   �...@override
  protected WebMarkupContainer newLink(String linkId, int index)
  {
    WebMarkupContainer link;

    // create default (not bookmarkable) links for the specified tabs.
    if (unbookmarkableTabIndex.contains(index))
      link = super.newLink(linkId, index);
    // create bookmarkable links
    else
    {
      if (index == defaultTabIndex)
        pageParameters.remove(tabParameterName);
      else
        pageParameters.put(tabParameterName,  + index);
      link = new BookmarkablePageLink(
              linkId, getPage().getClass(), pageParameters);
    }

    if (index == getSelectedTab())
      link.setEnabled(false);

    return link;
  }

 }
 ---






 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



ModalWindow and JQueryBehavior

2009-03-10 Thread Adriano dos Santos Fernandes

Hi!

Has anyone used ModalWindow with JQueryBehavior from wicket-stuff?

It seems to cause Javascript problems and the behavior does not do the job.

Is ModalWindow susceptible to problems with many Javascript interrelated 
contributions, some inline and some references?


Wicket DateTime component works for me.


Adriano


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Trying Hibernate Validator Integration

2009-03-10 Thread taha siddiqi
Hi,

I was working with Hibernate-validator and thought of sharing the code.

It is a listener as well as a behavior which can be used at
application level as well as with individual
components.

It is heavily inspired from wicket-jpa and wicket-hibernate
projects... I just tried some changes...

import java.util.Map;
import java.util.Arrays;
import java.util.List;
import java.util.Date;
import java.util.concurrent.ConcurrentHashMap;
import javax.persistence.Entity;
import javax.persistence.Embeddable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;

import org.hibernate.validator.NotNull;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotEmpty;
import org.hibernate.validator.Min;
import org.hibernate.validator.Pattern;
import org.hibernate.validator.Max;
import org.hibernate.validator.Range;
import org.hibernate.validator.Past;
import org.hibernate.validator.Future;
import org.hibernate.validator.Email;
import org.hibernate.validator.CreditCardNumber;

import org.apache.wicket.validation.validator.StringValidator;
import org.apache.wicket.validation.validator.PatternValidator;
import org.apache.wicket.validation.validator.NumberValidator;
import org.apache.wicket.validation.validator.EmailAddressValidator;
import org.apache.wicket.validation.validator.CreditCardValidator;
import org.apache.wicket.validation.validator.DateValidator;

import org.hibernate.validator.ClassValidator;
import org.hibernate.validator.InvalidValue;
import org.apache.wicket.behavior.AbstractBehavior;
import org.apache.wicket.application.IComponentOnBeforeRenderListener;
import org.apache.wicket.application.IComponentInstantiationListener;
import org.apache.wicket.Component;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.feedback.FeedbackMessage;
import org.apache.wicket.validation.IValidator;
import org.apache.wicket.validation.IValidatable;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.validation.ValidationError;
import org.apache.wicket.validation.validator.StringValidator;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.model.Model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * A validator to validate elements having
 * hibernate validators annotated.
 */
public class HibernateValidator extends AbstractBehavior
   implements IComponentOnBeforeRenderListener {

   private static Logger logger = LoggerFactory.getLogger(
HibernateValidator.class );

   public final void onBeforeRender( Component c ){
  if( !c.hasBeenRendered() ){
 configure(c);
  }
   }

   @Override
   public void beforeRender( Component c ){
  super.beforeRender( c );
  configure( c );
   }

   @SuppressWarnings( unchecked )
   private boolean configure( Component c ){
  if( !isApplicableFor( c ) ){
 return false;
  }

  FormComponent fc = (FormComponent)c;
  CompoundPropertyModel cpm =
 (CompoundPropertyModel)fc.getInnermostModel();

  Class clazz = cpm.getObject().getClass();
  if( clazz.isAnnotationPresent( Entity.class ) ||
  clazz.isAnnotationPresent( Embeddable.class ) ){

 try {
AnnotatedElement element = (AnnotatedElement)
   org.apache.wicket.util.lang.PropertyResolver.getPropertyGetter(
  fc.getId(), cpm.getObject() );

addValidator( fc, element );
 }catch( Exception ex ){
 }
  }

  return true;
   }

   protected void addValidator( FormComponent fc, AnnotatedElement element ){
  //@NotNull
  if( element.isAnnotationPresent( NotNull.class ) ||
  element.isAnnotationPresent( NotEmpty.class ) ){
 fc.setRequired( true );
  }

  //@Length( min, max )
  if( element.isAnnotationPresent( Length.class ) ){
 Length l = element.getAnnotation( Length.class );

 if( l.min() == 0  l.max()  Integer.MAX_VALUE ){ //TODO:
replace with max int
fc.add( StringValidator.maximumLength( l.max() ) );
 }else if( l.min() != 0  l.max()  Integer.MAX_VALUE ){
fc.add( StringValidator.lengthBetween( l.min(), l.max() ) );
 }else if( l.min() != 0  l.max() = Integer.MAX_VALUE ){
fc.add( StringValidator.minimumLength( l.min() ) );
 }
  }

  //@Max( value )
  if( element.isAnnotationPresent( Max.class ) ){
 Max max = element.getAnnotation( Max.class );
 fc.add( NumberValidator.maximum( max.value() ) );
  }

  //@Min( value )
  if( element.isAnnotationPresent( Min.class ) ){
 Min min = element.getAnnotation( Min.class );
 fc.add( NumberValidator.minimum( min.value() ) );
  }

  //@Range( min, max )
  if( element.isAnnotationPresent( Range.class ) ){

Wicket + Resin, Content-Length Header Issue

2009-03-10 Thread Seth Green

I'm running wicket (1.2.6) on both Jetty and Resin (3.0.25).

Everything appears to work correctly on Jetty. However, on Resin, when  
requesting the wicket-ajax.js file, it is sent back without a content- 
length header and is therefore unreadable by the browser. It appears  
this only happens when using compression (gzip, in this case).  
Requesting the file without compression, using cURL, returns the  
correct headers.


I am not using a proxy, this occurs when directly accessing Resin.

Has anyone every experienced this behavior, and/or can provide some  
insight?


Thanks.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



AW: AW: Tabbed Panel with bookmarkable links

2009-03-10 Thread Christian Helmbold

  What if you use two different tabbed panels on the same page?

 
 Good point! It doesn't work with two panels on the same page! I don't know 
 why 
 and how to fix it.

It was a mistake in my test code, that lead to this error. I accidentally added 
the tabs of my second tabbed panel to the first one. Multiple 
BookmarkableTabbedPanels work fine now.

Regards
Christian






-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket + Resin, Content-Length Header Issue

2009-03-10 Thread Ryan Gravener
I searched Resin Accept-Encoding and looks like I found your papernapkin
paste: http://www.papernapkin.org/pastebin/view/4871/

The response header had: Transfer-Encoding: chunked, which would mean that
the server is doing on the fly compression and no content-length will ever
be sent.  Perhaps resin is failing to compress the file.

Ryan Gravener
http://ryangravener.com/flex | http://twitter.com/ryangravener


On Tue, Mar 10, 2009 at 9:51 AM, Seth Green seth.m.gr...@gmail.com wrote:

 I'm running wicket (1.2.6) on both Jetty and Resin (3.0.25).

 Everything appears to work correctly on Jetty. However, on Resin, when
 requesting the wicket-ajax.js file, it is sent back without a content-length
 header and is therefore unreadable by the browser. It appears this only
 happens when using compression (gzip, in this case). Requesting the file
 without compression, using cURL, returns the correct headers.

 I am not using a proxy, this occurs when directly accessing Resin.

 Has anyone every experienced this behavior, and/or can provide some
 insight?

 Thanks.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: validation message-keys differences on m3 to rc2

2009-03-10 Thread Igor Vaynberg
jira, quickstart, you know the drill

-igor

On Tue, Mar 10, 2009 at 3:15 AM, gilberthuph gdoe6...@yahoo.it wrote:

 I'm having exactly the same problem after moving from 1.4-rc1 - 1.4-rc2

 Here's the extract from my properties file TaxiBookingPage.xml.

 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE properties SYSTEM http://java.sun.com/dtd/properties.dtd;
 properties
    entry key=generalDetails.numberOfVehiclesRequired.RequiredYou must
 enter the number of vehicles/entry
    .. snip ..
 /properties

 RC1
 
 The key generalDetails.numberOfVehiclesRequired.Required is found
 immediately and the appropriate message retrieved.

 11:00:38.595 [http-8180-3]     DEBUG org.apache.wicket.Session - Getting
 page [path = 4:taxiBookingForm, versionNumber = 0]
 11:00:38.609 [http-8180-3]     DEBUG
 org.apache.wicket.resource.loader.ComponentStringResourceLoader - Found
 resource from: com/rp/webapp/taxi/TaxiBookingPage.; key:
 generalDetails.numberOfVehiclesRequired.Required


 RC2
 
 Does not attempt to look up
 generalDetails.numberOfVehiclesRequired.Required but the key
 taxiBookingForm.numberOfVehiclesContainer.numberOfVehiclesRequiredBorder.generalDetails.numberOfVehiclesRequired.Required
 which is not found.

 10:47:47.902 [http-8180-1]     DEBUG org.apache.wicket.Localizer - Locate
 property: key: 'Required'; Component: '[MarkupContainer [Component id =
 generalDetails.numberOfVehiclesRequired]]'
 10:47:47.903 [http-8180-1]     DEBUG
 org.apache.wicket.resource.loader.ComponentStringResourceLoader - component:
 '[MarkupContainer [Component id =
 generalDetails.numberOfVehiclesRequired]]'; key: 'Required'
 10:47:47.903 [http-8180-1]     DEBUG
 org.apache.wicket.resource.loader.ComponentStringResourceLoader - key:
 'taxiBookingForm.numberOfVehiclesContainer.numberOfVehiclesRequiredBorder.generalDetails.numberOfVehiclesRequired.Required';
 class: 'com.rp.webapp.taxi.TaxiBookingPage'; locale: 'en_GB'; Style: 'null'
 10:47:47.903 [http-8180-1]     DEBUG
 org.apache.wicket.resource.loader.ComponentStringResourceLoader - Found
 properties file: 'com/rp/webapp/taxi/TaxiBookingPage.' but it doesn't
 contain the property

 So it seems the lookup algorithm hasn't changed but the message key.

 Is this a bug or should we now be using the full form-relative key as shown
 above?



 Alexander Lohse wrote:

 I could not find any reported changes concerning validation message
 keys from version 1.4-m3 to 1.4-rc2, but I have the following
 required key in my application resources that does not work anymore.
 .. trim ..


 --
 View this message in context: 
 http://www.nabble.com/validation-message-keys-differences-on-m3-to-rc2-tp22155986p22431244.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



resource cacheable firefox/opera

2009-03-10 Thread Arthur Leigh Allen
Hi folks,
 
I've implemented a RemoteImage class which extends the Image class.
The method setCacheable works with Internet Explorer but neither with Firefox 
nor with Opera.
If I load an image the first time, the correct image is shown.
When I try to load a different image (path is applied correctly), the old image 
is shown.

What I'm doing wrong?
I'm using wicket 1.3.5.
 
===
public
 classRemoteImage extendsImage {
    publicRemoteImage(String id, finalString path) {
        super(id);
    
        Resource resource = newWebResource() {
            publicIResourceStream getResourceStream() {
                IResourceStream stream = newFileResourceStream(newFile(path));
                returnstream;
            }
        };
 
        resource.setCacheable(false);
        setImageResource(resource);
    }
}
 
===
 
Would appreciate any help.
 
Thanks in advance
Leigh


  

Re: test page rendering

2009-03-10 Thread Igor Vaynberg
if you want the removal of wicket:id to fail turn on component use
check in debug settings.

-igor

On Tue, Mar 10, 2009 at 3:12 AM, Swanthe Lindgren
swanthe.lindg...@megasol.se wrote:
 Hi all
 I have begun unit testing my wicket pages and one of the most basic tests I
 want to do is to make sure each and every page can render properly. The
 WicketTester.assertRenderedPage() looks like a good approach but it doesnt
 seam to care about the HTML. If I remove a wicket:id from the markupfile,
 the test is still passed.
 Is this correct or might there be something else I have done wrong?

 //Swanthe




 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



AW: resource cacheable firefox/opera

2009-03-10 Thread Arthur Leigh Allen
sorry people.
i was trying all the time but i didn't see the class NonCachingImage

now it works





Von: Arthur Leigh Allen arthurleigh.al...@yahoo.de
An: users@wicket.apache.org
Gesendet: Dienstag, den 10. März 2009, 15:56:24 Uhr
Betreff: resource cacheable firefox/opera

Hi folks,
 
I've implemented a RemoteImage class which extends the Image class.
The method setCacheable works with Internet Explorer but neither with Firefox 
nor with Opera.
If I load an image the first time, the correct image is shown.
When I try to load a different image (path is applied correctly), the old image 
is shown.

What I'm doing wrong?
I'm using wicket 1.3.5.
 
===
public
 classRemoteImage extendsImage {
    publicRemoteImage(String id, finalString path) {
        super(id);
    
        Resource resource = newWebResource() {
            publicIResourceStream getResourceStream() {
                IResourceStream stream = newFileResourceStream(newFile(path));
                returnstream;
            }
        };
 
        resource.setCacheable(false);
        setImageResource(resource);
    }
}
 
===
 
Would appreciate any help.
 
Thanks in advance
Leigh


  

Re: Trying Hibernate Validator Integration

2009-03-10 Thread taha siddiqi
But the problem is when you begin to use the wicket resource files,
hibernate-validator comes with its own messages and need to be
integrated with wicket ( which i was not able to )

taha

On Tue, Mar 10, 2009 at 8:11 PM, Peter Thomas ptrtho...@gmail.com wrote:
 On Tue, Mar 10, 2009 at 7:35 AM, taha siddiqi tawushaf...@gmail.com wrote:

 Hi,

 I was working with Hibernate-validator and thought of sharing the code.


 Taha: I thought the ClassValidator will handle all the different cases and
 annotations for you, see line #89

 http://code.google.com/p/perfbench/source/browse/trunk/perfbench/wicket-jpa/src/main/java/wicketjpa/wicket/EditBorder.java#89

 Is there any advantage of mapping each type (e.g. Min, Max,
 CreditCardNumber) to Wicket built-in validators ?



 It is a listener as well as a behavior which can be used at
 application level as well as with individual
 components.

 It is heavily inspired from wicket-jpa and wicket-hibernate
 projects... I just tried some changes...

 import java.util.Map;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Date;
 import java.util.concurrent.ConcurrentHashMap;
 import javax.persistence.Entity;
 import javax.persistence.Embeddable;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.AnnotatedElement;

 import org.hibernate.validator.NotNull;
 import org.hibernate.validator.Length;
 import org.hibernate.validator.NotEmpty;
 import org.hibernate.validator.Min;
 import org.hibernate.validator.Pattern;
 import org.hibernate.validator.Max;
 import org.hibernate.validator.Range;
 import org.hibernate.validator.Past;
 import org.hibernate.validator.Future;
 import org.hibernate.validator.Email;
 import org.hibernate.validator.CreditCardNumber;

 import org.apache.wicket.validation.validator.StringValidator;
 import org.apache.wicket.validation.validator.PatternValidator;
 import org.apache.wicket.validation.validator.NumberValidator;
 import org.apache.wicket.validation.validator.EmailAddressValidator;
 import org.apache.wicket.validation.validator.CreditCardValidator;
 import org.apache.wicket.validation.validator.DateValidator;

 import org.hibernate.validator.ClassValidator;
 import org.hibernate.validator.InvalidValue;
 import org.apache.wicket.behavior.AbstractBehavior;
 import org.apache.wicket.application.IComponentOnBeforeRenderListener;
 import org.apache.wicket.application.IComponentInstantiationListener;
 import org.apache.wicket.Component;
 import org.apache.wicket.markup.ComponentTag;
 import org.apache.wicket.feedback.FeedbackMessage;
 import org.apache.wicket.validation.IValidator;
 import org.apache.wicket.validation.IValidatable;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.CompoundPropertyModel;
 import org.apache.wicket.markup.html.form.FormComponent;
 import org.apache.wicket.validation.ValidationError;
 import org.apache.wicket.validation.validator.StringValidator;
 import org.apache.wicket.AttributeModifier;
 import org.apache.wicket.model.Model;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

 /**
  * A validator to validate elements having
  * hibernate validators annotated.
  */
 public class HibernateValidator extends AbstractBehavior
   implements IComponentOnBeforeRenderListener {

   private static Logger logger = LoggerFactory.getLogger(
 HibernateValidator.class );

   public final void onBeforeRender( Component c ){
      if( !c.hasBeenRendered() ){
         configure(c);
      }
   }

   @Override
   public void beforeRender( Component c ){
      super.beforeRender( c );
      configure( c );
   }

   @SuppressWarnings( unchecked )
   private boolean configure( Component c ){
      if( !isApplicableFor( c ) ){
         return false;
      }

      FormComponent fc = (FormComponent)c;
      CompoundPropertyModel cpm =
         (CompoundPropertyModel)fc.getInnermostModel();

      Class clazz = cpm.getObject().getClass();
      if( clazz.isAnnotationPresent( Entity.class ) ||
          clazz.isAnnotationPresent( Embeddable.class ) ){

         try {
            AnnotatedElement element = (AnnotatedElement)

 org.apache.wicket.util.lang.PropertyResolver.getPropertyGetter(
                  fc.getId(), cpm.getObject() );

            addValidator( fc, element );
         }catch( Exception ex ){
         }
      }

      return true;
   }

   protected void addValidator( FormComponent fc, AnnotatedElement element
 ){
      //@NotNull
      if( element.isAnnotationPresent( NotNull.class ) ||
          element.isAnnotationPresent( NotEmpty.class ) ){
         fc.setRequired( true );
      }

      //@Length( min, max )
      if( element.isAnnotationPresent( Length.class ) ){
         Length l = element.getAnnotation( Length.class );

         if( l.min() == 0  l.max()  Integer.MAX_VALUE ){ //TODO:
 replace with max int
            fc.add( StringValidator.maximumLength( l.max() ) );
         }else if( 

Re: AW: Tabbed Panel with bookmarkable links

2009-03-10 Thread Brill Pappin
Instead of competing, why don't we set up a project some place and  
check both solutions in under different packages?

We can then refactor them into one and take the best of both :)

- Brill

On 10-Mar-09, at 8:27 AM, Christian Helmbold wrote:



Since others seem to need it, this might be worth refining over on  
wicket-stuff.


I think it's worth to build a universal bookmarkable tabbed panel.  
Brill, please post your solution so we can look what is better in  
your or in my solution and built the ultimative  
BookmarkableTabbedPanel.


I refined my first version a bit and added the following features:
* Reliable handling of user input (tab number).
* Possibility to mix bookmarkable and stateful links.
* Parameter name to distinguish tabs is now the component id by  
default. This will avoid conflicts with multiple  
BookmarkableTabbedPanels.


But I'm not sure if mixing bookmarkable and stateful links is a good  
idea.


Current version:
---
package com.helmbold.wicket.components;

import java.util.ArrayList;
import java.util.List;
import org.apache.wicket.PageParameters;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.extensions.markup.html.tabs.TabbedPanel;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.link..BookmarkablePageLink;


public class BookmarkableTabbedPanel extends TabbedPanel
{

   private PageParameters pageParameters;
   private String tabParameterName;
   private int defaultTabIndex = 0;
 private List unbookmarkableTabIndex = new ArrayList();


 /**
  * Using this constructor the following defaults take effect:
  * ul
  *litabParameterName = component id/li
  *lidefaultTabIndex = 0/li
  * /ul
* @param id component id
* @param tabs list of ITab objects used to represent tabs
  * @param pageParameters Container for parameters to a requested  
page. A

  * parameter for the selected tab will be inserted.
*/
 public BookmarkableTabbedPanel(
 String id,
 ListITab tabs,
 PageParameters pageParameters)
 {
   super(id, tabs);
   this.pageParameters = pageParameters;
   this.tabParameterName = id;

   if (pageParameters.containsKey(tabParameterName))
   {
 String tab = pageParameters.getString(tabParameterName);
 try
 {
   setSelectedTab(Integer.parseInt(tab));
 }
 catch (NumberFormatException e)
 {
   setSelectedTab(defaultTabIndex);
 }
   }
   else
 setSelectedTab(defaultTabIndex);
 }


   /**
* @param id component id
* @param tabs list of ITab objects used to represent tabs
* @param defaultTabIndex Set the tab to by displayed by default.  
The url
* for this tab will not contain any tab specific information. If  
you want to
* display the first tab by default, you can use the constructor  
without this

* parameter.
  * @param pageParameters Container for parameters to a requested  
page. A

  * parameter for the selected tab will be inserted.
*/
   public BookmarkableTabbedPanel(
   String id,
   ListITab tabs,
   int defaultTabIndex,
   String tabParameterName,
   PageParameters pageParameters,
   int ...unbookmarkableTabIndex)
   {
   this(id, tabs, pageParameters);
   this.defaultTabIndex = defaultTabIndex;
   setSelectedTab(defaultTabIndex);
   this.tabParameterName = tabParameterName;
   for(int element : unbookmarkableTabIndex)
 this.unbookmarkableTabIndex.add(element);
   }


   @Override
 protected WebMarkupContainer newLink(String linkId, int index)
 {
   WebMarkupContainer link;

   // create default (not bookmarkable) links for the specified tabs.
   if (unbookmarkableTabIndex.contains(index))
 link = super.newLink(linkId, index);
   // create bookmarkable links
   else
   {
 if (index == defaultTabIndex)
   pageParameters.remove(tabParameterName);
 else
   pageParameters.put(tabParameterName,  + index);
 link = new BookmarkablePageLink(
 linkId, getPage().getClass(), pageParameters);
   }

   if (index == getSelectedTab())
 link.setEnabled(false);

   return link;
 }

}
---






-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Trying Hibernate Validator Integration

2009-03-10 Thread Peter Thomas
On Tue, Mar 10, 2009 at 9:04 AM, taha siddiqi tawushaf...@gmail.com wrote:

 But the problem is when you begin to use the wicket resource files,
 hibernate-validator comes with its own messages and need to be
 integrated with wicket ( which i was not able to )


There is some info here on how to pass a resource-bundle to the
ClassValidator constructor, I haven't tried it though:

http://www.jboss.org/index.html?module=bbop=viewtopict=69783view=next




 taha

 On Tue, Mar 10, 2009 at 8:11 PM, Peter Thomas ptrtho...@gmail.com wrote:
  On Tue, Mar 10, 2009 at 7:35 AM, taha siddiqi tawushaf...@gmail.com
 wrote:
 
  Hi,
 
  I was working with Hibernate-validator and thought of sharing the code.
 
 
  Taha: I thought the ClassValidator will handle all the different cases
 and
  annotations for you, see line #89
 
 
 http://code.google.com/p/perfbench/source/browse/trunk/perfbench/wicket-jpa/src/main/java/wicketjpa/wicket/EditBorder.java#89
 
  Is there any advantage of mapping each type (e.g. Min, Max,
  CreditCardNumber) to Wicket built-in validators ?
 
 
 
  It is a listener as well as a behavior which can be used at
  application level as well as with individual
  components.
 
  It is heavily inspired from wicket-jpa and wicket-hibernate
  projects... I just tried some changes...
 
  import java.util.Map;
  import java.util.Arrays;
  import java.util.List;
  import java.util.Date;
  import java.util.concurrent.ConcurrentHashMap;
  import javax.persistence.Entity;
  import javax.persistence.Embeddable;
  import java.lang.reflect.Field;
  import java.lang.reflect.Method;
  import java.lang.annotation.Annotation;
  import java.lang.reflect.AnnotatedElement;
 
  import org.hibernate.validator.NotNull;
  import org.hibernate.validator.Length;
  import org.hibernate.validator.NotEmpty;
  import org.hibernate.validator.Min;
  import org.hibernate.validator.Pattern;
  import org.hibernate.validator.Max;
  import org.hibernate.validator.Range;
  import org.hibernate.validator.Past;
  import org.hibernate.validator.Future;
  import org.hibernate.validator.Email;
  import org.hibernate.validator.CreditCardNumber;
 
  import org.apache.wicket.validation.validator.StringValidator;
  import org.apache.wicket.validation.validator.PatternValidator;
  import org.apache.wicket.validation.validator.NumberValidator;
  import org.apache.wicket.validation.validator.EmailAddressValidator;
  import org.apache.wicket.validation.validator.CreditCardValidator;
  import org.apache.wicket.validation.validator.DateValidator;
 
  import org.hibernate.validator.ClassValidator;
  import org.hibernate.validator.InvalidValue;
  import org.apache.wicket.behavior.AbstractBehavior;
  import org.apache.wicket.application.IComponentOnBeforeRenderListener;
  import org.apache.wicket.application.IComponentInstantiationListener;
  import org.apache.wicket.Component;
  import org.apache.wicket.markup.ComponentTag;
  import org.apache.wicket.feedback.FeedbackMessage;
  import org.apache.wicket.validation.IValidator;
  import org.apache.wicket.validation.IValidatable;
  import org.apache.wicket.model.IModel;
  import org.apache.wicket.model.CompoundPropertyModel;
  import org.apache.wicket.markup.html.form.FormComponent;
  import org.apache.wicket.validation.ValidationError;
  import org.apache.wicket.validation.validator.StringValidator;
  import org.apache.wicket.AttributeModifier;
  import org.apache.wicket.model.Model;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
 
  /**
   * A validator to validate elements having
   * hibernate validators annotated.
   */
  public class HibernateValidator extends AbstractBehavior
implements IComponentOnBeforeRenderListener {
 
private static Logger logger = LoggerFactory.getLogger(
  HibernateValidator.class );
 
public final void onBeforeRender( Component c ){
   if( !c.hasBeenRendered() ){
  configure(c);
   }
}
 
@Override
public void beforeRender( Component c ){
   super.beforeRender( c );
   configure( c );
}
 
@SuppressWarnings( unchecked )
private boolean configure( Component c ){
   if( !isApplicableFor( c ) ){
  return false;
   }
 
   FormComponent fc = (FormComponent)c;
   CompoundPropertyModel cpm =
  (CompoundPropertyModel)fc.getInnermostModel();
 
   Class clazz = cpm.getObject().getClass();
   if( clazz.isAnnotationPresent( Entity.class ) ||
   clazz.isAnnotationPresent( Embeddable.class ) ){
 
  try {
 AnnotatedElement element = (AnnotatedElement)
 
  org.apache.wicket.util.lang.PropertyResolver.getPropertyGetter(
   fc.getId(), cpm.getObject() );
 
 addValidator( fc, element );
  }catch( Exception ex ){
  }
   }
 
   return true;
}
 
protected void addValidator( FormComponent fc, AnnotatedElement
 element
  ){
   //@NotNull
   if( element.isAnnotationPresent( NotNull.class ) ||
 

Re: Tabbed Panel with bookmarkable links

2009-03-10 Thread Brill Pappin

That is exactly the problem I *do* have :)
Have not resolved it yet, but I was thinking or allowing them to be  
nested to its actually one tab panel, but with multiple levels.


- Brill

On 10-Mar-09, at 8:41 AM, James Carman wrote:


What if you use two different tabbed panels on the same page?

On Tue, Mar 10, 2009 at 8:27 AM, Christian Helmbold
christian.helmb...@yahoo.de wrote:


Since others seem to need it, this might be worth refining over on  
wicket-stuff.


I think it's worth to build a universal bookmarkable tabbed panel.  
Brill, please post your solution so we can look what is better in  
your or in my solution and built the ultimative  
BookmarkableTabbedPanel.


I refined my first version a bit and added the following features:
* Reliable handling of user input (tab number).
* Possibility to mix bookmarkable and stateful links.
* Parameter name to distinguish tabs is now the component id by  
default. This will avoid conflicts with multiple  
BookmarkableTabbedPanels.


But I'm not sure if mixing bookmarkable and stateful links is a  
good idea.


Current version:
---
package com.helmbold.wicket.components;

import java.util.ArrayList;
import java.util.List;
import org.apache.wicket.PageParameters;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.extensions.markup.html.tabs.TabbedPanel;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.link..BookmarkablePageLink;


public class BookmarkableTabbedPanel extends TabbedPanel
{

   private PageParameters pageParameters;
   private String tabParameterName;
   private int defaultTabIndex = 0;
 private List unbookmarkableTabIndex = new ArrayList();


 /**
  * Using this constructor the following defaults take effect:
  * ul
  *litabParameterName = component id/li
  *lidefaultTabIndex = 0/li
  * /ul
* @param id component id
* @param tabs list of ITab objects used to represent tabs
  * @param pageParameters Container for parameters to a requested  
page. A

  * parameter for the selected tab will be inserted.
*/
 public BookmarkableTabbedPanel(
 String id,
 ListITab tabs,
 PageParameters pageParameters)
 {
   super(id, tabs);
   this.pageParameters = pageParameters;
   this.tabParameterName = id;

   if (pageParameters.containsKey(tabParameterName))
   {
 String tab = pageParameters.getString(tabParameterName);
 try
 {
   setSelectedTab(Integer.parseInt(tab));
 }
 catch (NumberFormatException e)
 {
   setSelectedTab(defaultTabIndex);
 }
   }
   else
 setSelectedTab(defaultTabIndex);
 }


   /**
* @param id component id
* @param tabs list of ITab objects used to represent tabs
* @param defaultTabIndex Set the tab to by displayed by  
default. The url
* for this tab will not contain any tab specific information.  
If you want to
* display the first tab by default, you can use the constructor  
without this

* parameter.
  * @param pageParameters Container for parameters to a requested  
page. A

  * parameter for the selected tab will be inserted.
*/
   public BookmarkableTabbedPanel(
   String id,
   ListITab tabs,
   int defaultTabIndex,
   String tabParameterName,
   PageParameters pageParameters,
   int ...unbookmarkableTabIndex)
   {
   this(id, tabs, pageParameters);
   this.defaultTabIndex = defaultTabIndex;
   setSelectedTab(defaultTabIndex);
   this.tabParameterName = tabParameterName;
   for(int element : unbookmarkableTabIndex)
 this.unbookmarkableTabIndex.add(element);
   }


   @Override
 protected WebMarkupContainer newLink(String linkId, int index)
 {
   WebMarkupContainer link;

   // create default (not bookmarkable) links for the specified tabs.
   if (unbookmarkableTabIndex.contains(index))
 link = super.newLink(linkId, index);
   // create bookmarkable links
   else
   {
 if (index == defaultTabIndex)
   pageParameters.remove(tabParameterName);
 else
   pageParameters.put(tabParameterName,  + index);
 link = new BookmarkablePageLink(
 linkId, getPage().getClass(), pageParameters);
   }

   if (index == getSelectedTab())
 link.setEnabled(false);

   return link;
 }

}
---






-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: 

Re: resource cacheable firefox/opera

2009-03-10 Thread Pointbreak
You use the same url for different images? Firefox uses a memory cache
in addition to a disk cache. Check what headers are send with your
image. No-store and no-cache headers will NOT prevent firefox3 from
using its memory cache (at least not with pages). Your best bet is to
use different urls.

On Tue, 10 Mar 2009 14:56 +, Arthur Leigh Allen
arthurleigh.al...@yahoo.de wrote:
 Hi folks,
  
 I've implemented a RemoteImage class which extends the Image class.
 The method setCacheable works with Internet Explorer but neither with
 Firefox nor with Opera.
 If I load an image the first time, the correct image is shown.
 When I try to load a different image (path is applied correctly), the old
 image is shown.
 
 What I'm doing wrong?
 I'm using wicket 1.3.5.
  
 ===
 public
  classRemoteImage extendsImage {
     publicRemoteImage(String id, finalString path) {
         super(id);
     
         Resource resource = newWebResource() {
             publicIResourceStream getResourceStream() {
                 IResourceStream stream = newFileResourceStream(newFile(path));
                 returnstream;
             }
         };
  
         resource.setCacheable(false);
         setImageResource(resource);
     }
 }
  
 ===
  
 Would appreciate any help.
  
 Thanks in advance
 Leigh
 
 
   

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



AW: AW: Tabbed Panel with bookmarkable links

2009-03-10 Thread Christian Helmbold

 Instead of competing, why don't we set up a project some place and check both 
 solutions in under different packages?
 We can then refactor them into one and take the best of both :)

I agree. Is there an existing place in the wicket project to do this?

I've discovered some troubles in my solution when multiple tabbed panes are 
used in one page. The state of other panels is not hold correctly in the URLs 
and so the tabbed panels influence each other. 





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Trying Hibernate Validator Integration

2009-03-10 Thread taha siddiqi
but then how to get a ResourceBundle from wicket resource ??


On Tue, Mar 10, 2009 at 8:43 PM, Peter Thomas ptrtho...@gmail.com wrote:
 On Tue, Mar 10, 2009 at 9:04 AM, taha siddiqi tawushaf...@gmail.com wrote:

 But the problem is when you begin to use the wicket resource files,
 hibernate-validator comes with its own messages and need to be
 integrated with wicket ( which i was not able to )


 There is some info here on how to pass a resource-bundle to the
 ClassValidator constructor, I haven't tried it though:

 http://www.jboss.org/index.html?module=bbop=viewtopict=69783view=next




 taha

 On Tue, Mar 10, 2009 at 8:11 PM, Peter Thomas ptrtho...@gmail.com wrote:
  On Tue, Mar 10, 2009 at 7:35 AM, taha siddiqi tawushaf...@gmail.com
 wrote:
 
  Hi,
 
  I was working with Hibernate-validator and thought of sharing the code.
 
 
  Taha: I thought the ClassValidator will handle all the different cases
 and
  annotations for you, see line #89
 
 
 http://code.google.com/p/perfbench/source/browse/trunk/perfbench/wicket-jpa/src/main/java/wicketjpa/wicket/EditBorder.java#89
 
  Is there any advantage of mapping each type (e.g. Min, Max,
  CreditCardNumber) to Wicket built-in validators ?
 
 
 
  It is a listener as well as a behavior which can be used at
  application level as well as with individual
  components.
 
  It is heavily inspired from wicket-jpa and wicket-hibernate
  projects... I just tried some changes...
 
  import java.util.Map;
  import java.util.Arrays;
  import java.util.List;
  import java.util.Date;
  import java.util.concurrent.ConcurrentHashMap;
  import javax.persistence.Entity;
  import javax.persistence.Embeddable;
  import java.lang.reflect.Field;
  import java.lang.reflect.Method;
  import java.lang.annotation.Annotation;
  import java.lang.reflect.AnnotatedElement;
 
  import org.hibernate.validator.NotNull;
  import org.hibernate.validator.Length;
  import org.hibernate.validator.NotEmpty;
  import org.hibernate.validator.Min;
  import org.hibernate.validator.Pattern;
  import org.hibernate.validator.Max;
  import org.hibernate.validator.Range;
  import org.hibernate.validator.Past;
  import org.hibernate.validator.Future;
  import org.hibernate.validator.Email;
  import org.hibernate.validator.CreditCardNumber;
 
  import org.apache.wicket.validation.validator.StringValidator;
  import org.apache.wicket.validation.validator.PatternValidator;
  import org.apache.wicket.validation.validator.NumberValidator;
  import org.apache.wicket.validation.validator.EmailAddressValidator;
  import org.apache.wicket.validation.validator.CreditCardValidator;
  import org.apache.wicket.validation.validator.DateValidator;
 
  import org.hibernate.validator.ClassValidator;
  import org.hibernate.validator.InvalidValue;
  import org.apache.wicket.behavior.AbstractBehavior;
  import org.apache.wicket.application.IComponentOnBeforeRenderListener;
  import org.apache.wicket.application.IComponentInstantiationListener;
  import org.apache.wicket.Component;
  import org.apache.wicket.markup.ComponentTag;
  import org.apache.wicket.feedback.FeedbackMessage;
  import org.apache.wicket.validation.IValidator;
  import org.apache.wicket.validation.IValidatable;
  import org.apache.wicket.model.IModel;
  import org.apache.wicket.model.CompoundPropertyModel;
  import org.apache.wicket.markup.html.form.FormComponent;
  import org.apache.wicket.validation.ValidationError;
  import org.apache.wicket.validation.validator.StringValidator;
  import org.apache.wicket.AttributeModifier;
  import org.apache.wicket.model.Model;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
 
  /**
   * A validator to validate elements having
   * hibernate validators annotated.
   */
  public class HibernateValidator extends AbstractBehavior
    implements IComponentOnBeforeRenderListener {
 
    private static Logger logger = LoggerFactory.getLogger(
  HibernateValidator.class );
 
    public final void onBeforeRender( Component c ){
       if( !c.hasBeenRendered() ){
          configure(c);
       }
    }
 
    @Override
    public void beforeRender( Component c ){
       super.beforeRender( c );
       configure( c );
    }
 
    @SuppressWarnings( unchecked )
    private boolean configure( Component c ){
       if( !isApplicableFor( c ) ){
          return false;
       }
 
       FormComponent fc = (FormComponent)c;
       CompoundPropertyModel cpm =
          (CompoundPropertyModel)fc.getInnermostModel();
 
       Class clazz = cpm.getObject().getClass();
       if( clazz.isAnnotationPresent( Entity.class ) ||
           clazz.isAnnotationPresent( Embeddable.class ) ){
 
          try {
             AnnotatedElement element = (AnnotatedElement)
 
  org.apache.wicket.util.lang.PropertyResolver.getPropertyGetter(
                   fc.getId(), cpm.getObject() );
 
             addValidator( fc, element );
          }catch( Exception ex ){
          }
       }
 
       return true;
    }
 
    protected void 

Re: Tabbed Panel with bookmarkable links

2009-03-10 Thread James Carman
It may not be worth it.  Having multiple tabbed panels on the same
page may not be a very common usecase.  Perhaps it's better to settle
for YAGNI in this case and if it really does comes up and someone
wants to solve the issue, then address it then.  But, for now, a good
Javadoc warning might suffice.  It might not be worth cluttering up
the code (no idea what it'd take to fix).

On Tue, Mar 10, 2009 at 11:14 AM, Brill Pappin br...@pappin.ca wrote:
 That is exactly the problem I *do* have :)
 Have not resolved it yet, but I was thinking or allowing them to be nested
 to its actually one tab panel, but with multiple levels.

 - Brill

 On 10-Mar-09, at 8:41 AM, James Carman wrote:

 What if you use two different tabbed panels on the same page?

 On Tue, Mar 10, 2009 at 8:27 AM, Christian Helmbold
 christian.helmb...@yahoo.de wrote:

 Since others seem to need it, this might be worth refining over on
 wicket-stuff.

 I think it's worth to build a universal bookmarkable tabbed panel. Brill,
 please post your solution so we can look what is better in your or in my
 solution and built the ultimative BookmarkableTabbedPanel.

 I refined my first version a bit and added the following features:
 * Reliable handling of user input (tab number).
 * Possibility to mix bookmarkable and stateful links.
 * Parameter name to distinguish tabs is now the component id by default.
 This will avoid conflicts with multiple BookmarkableTabbedPanels.

 But I'm not sure if mixing bookmarkable and stateful links is a good
 idea.

 Current version:

 ---
 package com.helmbold.wicket.components;

 import java.util.ArrayList;
 import java.util.List;
 import org.apache.wicket.PageParameters;
 import org.apache.wicket.extensions.markup.html.tabs.ITab;
 import org.apache.wicket.extensions.markup.html.tabs.TabbedPanel;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.link..BookmarkablePageLink;


 public class BookmarkableTabbedPanel extends TabbedPanel
 {

   private PageParameters pageParameters;
   private String tabParameterName;
   private int defaultTabIndex = 0;
  private List unbookmarkableTabIndex = new ArrayList();


  /**
  * Using this constructor the following defaults take effect:
  * ul
  *    litabParameterName = component id/li
  *    lidefaultTabIndex = 0/li
  * /ul
    * @param id component id
    * @param tabs list of ITab objects used to represent tabs
  * @param pageParameters Container for parameters to a requested page. A
  * parameter for the selected tab will be inserted.
    */
  public BookmarkableTabbedPanel(
         String id,
         ListITab tabs,
         PageParameters pageParameters)
  {
   super(id, tabs);
   this.pageParameters = pageParameters;
   this.tabParameterName = id;

   if (pageParameters.containsKey(tabParameterName))
   {
     String tab = pageParameters.getString(tabParameterName);
     try
     {
       setSelectedTab(Integer.parseInt(tab));
     }
     catch (NumberFormatException e)
     {
       setSelectedTab(defaultTabIndex);
     }
   }
   else
     setSelectedTab(defaultTabIndex);
  }


   /**
    * @param id component id
    * @param tabs list of ITab objects used to represent tabs
    * @param defaultTabIndex Set the tab to by displayed by default. The
 url
    * for this tab will not contain any tab specific information. If you
 want to
    * display the first tab by default, you can use the constructor
 without this
    * parameter.
  * @param pageParameters Container for parameters to a requested page. A
  * parameter for the selected tab will be inserted.
    */
   public BookmarkableTabbedPanel(
       String id,
       ListITab tabs,
       int defaultTabIndex,
       String tabParameterName,
   PageParameters pageParameters,
   int ...unbookmarkableTabIndex)
   {
       this(id, tabs, pageParameters);
       this.defaultTabIndex = defaultTabIndex;
       setSelectedTab(defaultTabIndex);
       this.tabParameterName = tabParameterName;
   for(int element : unbookmarkableTabIndex)
     this.unbookmarkableTabIndex.add(element);
   }


   @Override
  protected WebMarkupContainer newLink(String linkId, int index)
  {
   WebMarkupContainer link;

   // create default (not bookmarkable) links for the specified tabs.
   if (unbookmarkableTabIndex.contains(index))
     link = super.newLink(linkId, index);
   // create bookmarkable links
   else
   {
     if (index == defaultTabIndex)
       pageParameters.remove(tabParameterName);
     else
       pageParameters.put(tabParameterName,  + index);
     link = new BookmarkablePageLink(
             linkId, getPage().getClass(), pageParameters);
   }

   if (index == getSelectedTab())
     link.setEnabled(false);

   return link;
  }

 }

 ---






 

Re: Wicket + Resin, Content-Length Header Issue

2009-03-10 Thread Seth Green
So... The only compression I know of is resin has a GZIP filter on it.  
But that means that everything is being GZIP'd, which is what I see in  
the headers for all requests (both to wicket /host/app/... and to non- 
wicket resources /host/css/...).


I believe this (the wicket-generated wicket-ajax.js) is the first and  
only wicket-served static resource I have used (all of my other  
javascript,css, etc. is outside of wicket).


So the differences are

1) Resin (since it works with Jetty)
2) Use of a wicket-served static resource (since all other types of  
files work).


I have a feeling if I knew more about the internals of wicket's  
mechanism for serving static resources, I might be able to figure out  
why this is breaking on Resin and not on Jetty.






On Mar 10, 2009, at  10:30 AM, Ryan Gravener wrote:

I searched Resin Accept-Encoding and looks like I found your  
papernapkin

paste: http://www.papernapkin.org/pastebin/view/4871/

The response header had: Transfer-Encoding: chunked, which would  
mean that
the server is doing on the fly compression and no content-length  
will ever

be sent.  Perhaps resin is failing to compress the file.

Ryan Gravener
http://ryangravener.com/flex | http://twitter.com/ryangravener


On Tue, Mar 10, 2009 at 9:51 AM, Seth Green seth.m.gr...@gmail.com  
wrote:



I'm running wicket (1.2.6) on both Jetty and Resin (3.0.25).

Everything appears to work correctly on Jetty. However, on Resin,  
when
requesting the wicket-ajax.js file, it is sent back without a  
content-length
header and is therefore unreadable by the browser. It appears this  
only
happens when using compression (gzip, in this case). Requesting the  
file

without compression, using cURL, returns the correct headers.

I am not using a proxy, this occurs when directly accessing Resin.

Has anyone every experienced this behavior, and/or can provide some
insight?

Thanks.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Need to minimize the names using Ajax

2009-03-10 Thread newbie_to_wicket

Hi All,
I am using wicket framework.
I have to achieve the functionality as I shown in the below image.
  http://www.nabble.com/file/p22437770/names.jpeg 
Whenever I pressed R in the textfield box then it should displays the names
which contans R as the first letter.


Thanks for your help
J

-- 
View this message in context: 
http://www.nabble.com/Need-to-minimize-the-names-using-Ajax-tp22437770p22437770.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



AW: Tabbed Panel with bookmarkable links

2009-03-10 Thread Christian Helmbold

The problem is that the tabbed panels have to know the state of other panels to 
generate correct stateful links. So we need some object that keeps track of all 
tabbed panels and their states. This object must be initialized before the 
newLink method is called. But this method is called during construction, so it 
can not know other tabbed panels when the first tabbed panel is constructed.

This object can be pageParameters. The only problem is, that this object 
doesn't reflect the actual state in every case, because it is also used for url 
construction. The solution is to remove items from pageParameters after url 
construction if they don't reflect the state.

And here comes the solution. It is now possible to use multiple 
BookmarkableTabbedPanels within one page.



package com.helmbold.wicket.components;

import java.util.ArrayList;
import java.util.List;
import org.apache.wicket.PageParameters;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.extensions.markup.html.tabs.TabbedPanel;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;


public class BookmarkableTabbedPanel extends TabbedPanel
{

private PageParameters pageParameters;
private String tabParameterName;
private int defaultTabIndex = 0;
  private List unbookmarkableTabIndex = new ArrayList();


  /**
   * Using this constructor the following defaults take effect:
   * ul
   *litabParameterName = component id/li
   *lidefaultTabIndex = 0/li
   * /ul
 * @param id component id
 * @param tabs list of ITab objects used to represent tabs
   * @param pageParameters Container for parameters to a requested page. A
   * parameter for the selected tab will be inserted.
 */
  public BookmarkableTabbedPanel(
  String id,
  ListITab tabs,
  PageParameters pageParameters)
  {
super(id, tabs);
this.pageParameters = pageParameters;
this.tabParameterName = id;

if (pageParameters.containsKey(tabParameterName))
{
  String tab = pageParameters.getString(tabParameterName);
  try
  {
setSelectedTab(Integer.parseInt(tab));
  }
  catch (NumberFormatException e)
  {
setSelectedTab(defaultTabIndex);
  }
}
else
  setSelectedTab(defaultTabIndex);
  }


/**
 * @param id component id
 * @param tabs list of ITab objects used to represent tabs
 * @param defaultTabIndex Set the tab to by displayed by default. The url
 * for this tab will not contain any tab specific information. If you want 
to 
 * display the first tab by default, you can use the constructor without 
this 
 * parameter.
   * @param pageParameters Container for parameters to a requested page. A
   * parameter for the selected tab will be inserted.
 */
public BookmarkableTabbedPanel(
String id, 
ListITab tabs,
int defaultTabIndex,
String tabParameterName,
PageParameters pageParameters,
int ...unbookmarkableTabIndex) 
{
this(id, tabs, pageParameters);
this.defaultTabIndex = defaultTabIndex;
setSelectedTab(defaultTabIndex);
this.tabParameterName = tabParameterName;
for(int element : unbookmarkableTabIndex)
  this.unbookmarkableTabIndex.add(element);
}


@Override
  protected WebMarkupContainer newLink(String linkId, int index)
  {
WebMarkupContainer link;

// create default (not bookmarkable) links for the specified tabs.
if (unbookmarkableTabIndex.contains(index))
  link = super.newLink(linkId, index);
// create bookmarkable links
else
{
  if (index == defaultTabIndex)
pageParameters.remove(tabParameterName);
  else
pageParameters.put(tabParameterName,  + index);
  link = new BookmarkablePageLink(
  linkId, getPage().getClass(), pageParameters);
  
  /* Overwrite tabIndexes only used for link cunstruction, but doesn't
   * reflect the actual state.
   */
  if (index != getSelectedTab())
pageParameters.put(tabParameterName,  + getSelectedTab());
}

if (index == getSelectedTab())
  link.setEnabled(false);

return link;
  }
  
}


Regards
Christian






-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Need to minimize the names using Ajax

2009-03-10 Thread Sébastien Piller

Use an AjaxEditableLabel.

newbie_to_wicket wrote:

Hi All,
I am using wicket framework.
I have to achieve the functionality as I shown in the below image.
  http://www.nabble.com/file/p22437770/names.jpeg 
Whenever I pressed R in the textfield box then it should displays the names

which contans R as the first letter.


Thanks for your help
J

  



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Need to minimize the names using Ajax

2009-03-10 Thread Igor Vaynberg
see AutoCompleteTextField

-igor

On Tue, Mar 10, 2009 at 8:14 AM, newbie_to_wicket sm.shaf...@gmail.comwrote:


 Hi All,
 I am using wicket framework.
 I have to achieve the functionality as I shown in the below image.
  http://www.nabble.com/file/p22437770/names.jpeg
 Whenever I pressed R in the textfield box then it should displays the names
 which contans R as the first letter.


 Thanks for your help
 J

 --
 View this message in context:
 http://www.nabble.com/Need-to-minimize-the-names-using-Ajax-tp22437770p22437770.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: 5 Days of Wicket

2009-03-10 Thread Andrew Lombardi
Thanks for the kind words!  We don't plan to cover databinder in these  
tutorials, but would definitely be willing to do some follow-on's at a  
later date.  And yeah, the image is different than the pastebin that  
follows it in the writing, but we didn't have a UI yet :)


If you like that, day 2 is a writing tests portion which I think sets  
up the idea quite nicely, later on, probably on day 4 we'll do some  
talking about WicketTester as well:


http://www.mysticcoders.com/blog/2009/03/10/5-days-of-wicket-writing-the-tests/

Cheers!

On Mar 10, 2009, at 2:19 AM, Korbinian Bachl - privat wrote:


Hi Andrew,

first I was a bit curious about another wicket intro(TM) but after  
reading it I was amazed. It is one of the best blog entries for  
wicket starting I've read as it elegantly uses helps like the  
quickstart and then shows how to config it for real world usage.


Only things I miss is:

- as you use Hibernate directly you really should mention  
databinder (databinder.net) somehow, as this spares you much work in  
that way


- some more words to the image thing, as its IMHO not clear why  
youre doing this for a pastebin-like app


*Thumbs up*,

Korbinian


Andrew Lombardi schrieb:

Hey guys,
Just wanted to let you guys know, that here at Mystic we're doing a  
series of blog posts about Wicket, the basics on setting everything  
up, tests, backend, components, etc.  If you're interested, would  
definitely love your comments (on the blog and mailing list of  
course).  We're definitely in love with how Wicket performs for us  
in our development and strive to use it in our projects when it  
makes sense.  I'll also be giving a talk about Wicket at TSSJS/LV  
in a week (gah!), so stop by and say hello: http://javasymposium.techtarget.com/html/frameworks.html#ALombardiWicket

Here's the intro article, showing what each day will cover:
http://www.mysticcoders.com/blog/2009/03/09/5-days-of-wicket/
and here's day 1 of 5 (duh!):
http://www.mysticcoders.com/blog/2009/03/09/5-days-of-wicket-day-1/
and if you have digg / reddit, and wouldn't mind upvoting it:
reddit info:
http://bit.ly/3DS2F
http://bit.ly/CFzVI
digg info:
http://bit.ly/PpLD
http://bit.ly/HM0kl
Cheers!
To our success!
Mystic Coders, LLC | Code Magic | www.mysticcoders.com
ANDREW LOMBARDI | and...@mysticcoders.com
2321 E 4th St. Ste C-128, Santa Ana CA 92705
ofc: 949-528-6480
fax: 714-782-6024
cell: 714-697-8046
linked-in: http://www.linkedin.com/in/andrewlombardi
Eco-Tip: Printing e-mails is usually a waste.

This message is for the named person's use only. You must not,  
directly or indirectly, use,
disclose, distribute, print, or copy any part of this message if  
you are not the intended recipient.




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




To our success!

Mystic Coders, LLC | Code Magic | www.mysticcoders.com

ANDREW LOMBARDI | and...@mysticcoders.com
2321 E 4th St. Ste C-128, Santa Ana CA 92705
ofc: 949-528-6480
fax: 714-782-6024
cell: 714-697-8046
linked-in: http://www.linkedin.com/in/andrewlombardi

Eco-Tip: Printing e-mails is usually a waste.


This message is for the named person's use only. You must not,  
directly or indirectly, use,
 disclose, distribute, print, or copy any part of this message if you  
are not the intended recipient.





AW: AW: Tabbed Panel with bookmarkable links

2009-03-10 Thread Christian Helmbold

In my code were two little bugs. If the constructor with parameter 
defaultTabIndex was used, the active tab was always set to this value 
regardless what tab the use clicked on. The other issue affected the specified 
parameter name that stores the active tab. It did not work in the constructor 
chain. This problem could be solved by rearrangement of constructors or by 
simple remove this parameter. I've choosen the last possibility to keep thinks 
simple.

 I post my corrected code again here, becaus someone could find it with a 
search engine and I don't want left him alone with broken code. The further 
development will be better placed in a code repository.

package com.helmbold.wicket.components;

import java.util.ArrayList;
import java.util.List;
import org.apache.wicket.PageParameters;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.extensions.markup.html.tabs.TabbedPanel;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;


public class BookmarkableTabbedPanel extends TabbedPanel
{

private PageParameters pageParameters;
private String tabParameterName;
private int defaultTabIndex = 0;
  private List unbookmarkableTabIndex = new ArrayList();


  /**
   * Using this constructor the following defaults take effect:
   * ul
   *litabParameterName = component id/li
   *lidefaultTabIndex = 0/li
   * /ul
 * @param id component id
 * @param tabs list of ITab objects used to represent tabs
   * @param pageParameters Container for parameters to a requested page. A
   * parameter for the selected tab will be inserted.
 */
  public BookmarkableTabbedPanel(
  String id,
  ListITab tabs,
  PageParameters pageParameters)
  {
super(id, tabs);
this.pageParameters = pageParameters;
this.tabParameterName = id;
System.err.println(pageParameters);
if (pageParameters.containsKey(tabParameterName))
{
  String tab = pageParameters.getString(tabParameterName);
  try
  {
setSelectedTab(Integer.parseInt(tab));
  }
  catch (NumberFormatException e)
  {
setSelectedTab(defaultTabIndex);
  }
}
else
  setSelectedTab(defaultTabIndex);
  }


/**
 * @param id component id
 * @param tabs list of ITab objects used to represent tabs
 * @param defaultTabIndex Set the tab to by displayed by default. The url
 * for this tab will not contain any tab specific information. If you want 
to 
 * display the first tab by default, you can use the constructor without 
this 
 * parameter.
   * @param pageParameters Container for parameters to a requested page. A
   * parameter for the selected tab will be inserted.
   * @param unbookmarkableTabIndex Indexes of tabs with standard (no
   * bookmarkable) links. First tab has index 0.
 */
public BookmarkableTabbedPanel(
String id, 
ListITab tabs,
int defaultTabIndex,
PageParameters pageParameters,
int ...unbookmarkableTabIndex) 
{
this(id, tabs, pageParameters);
this.defaultTabIndex = defaultTabIndex;
if (!pageParameters.containsKey(tabParameterName))
  setSelectedTab(defaultTabIndex);
for(int element : unbookmarkableTabIndex)
  this.unbookmarkableTabIndex.add(element);
}


@Override
  protected WebMarkupContainer newLink(String linkId, int index)
  {
WebMarkupContainer link;

// create default (not bookmarkable) links for the specified tabs.
if (unbookmarkableTabIndex.contains(index))
  link = super.newLink(linkId, index);
// create bookmarkable links
else
{
  if (index == defaultTabIndex)
pageParameters.remove(tabParameterName); // keep URLs short
  else
pageParameters.put(tabParameterName,  + index);
  link = new BookmarkablePageLink(
  linkId, getPage().getClass(), pageParameters);
  
  /* Overwrite parameters only used for link cunstruction, but doesn't
   * reflect the actual state.
   */
  if (index != getSelectedTab())
pageParameters.put(tabParameterName,  + getSelectedTab());
}

if (index == getSelectedTab())
  link.setEnabled(false);

return link;
  }
  
}





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



StatelessForm - problem with parameters after validation fails

2009-03-10 Thread Stefan Simik

Many wicket users are reporting the same and common problem - page parameters
are doubling in ACTION of the stateless form after first validation error.
Is there any solution please ? I think, this is very common use case and
some solution must exist.

See the same reports here:
1. 
http://www.nabble.com/StatelessForm-in-Bookmarkable-Page-problem-td19430608.html#a19430608
http://www.nabble.com/StatelessForm-in-Bookmarkable-Page-problem-td19430608.html#a19430608
 
2. 
http://www.nabble.com/StatelessForm-and-field-parameters-in-url-after-post-td21828632.html#a21828632
http://www.nabble.com/StatelessForm-and-field-parameters-in-url-after-post-td21828632.html#a21828632
 
3. 
http://www.nabble.com/StatelessForm-data-becomes-PageParameters-and-as-result-is-doubling-td19521093.html#a19521093
http://www.nabble.com/StatelessForm-data-becomes-PageParameters-and-as-result-is-doubling-td19521093.html#a19521093
 

-- 
View this message in context: 
http://www.nabble.com/StatelessForm---problem-with-parameters-after-validation-fails-tp22438953p22438953.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How (not) to: IModel and Collections (and generics)

2009-03-10 Thread Johannes Schneider
Thanks for your reply. I think I can (at least partially) understand
your position and think there aren't any new arguments here I can
mention. So the discussions seems to be at an end here.

Maybe it is a matter of taste... If I find any time, I will create a
patch...


Regards,

Johannes

On Sat, 2009-03-07 at 12:40 -0800, Igor Vaynberg wrote:
 you are right, the components that just read a collection do just
 that, read it. they simply ignore the setter method in imodel. no big
 deal, just because you are given an interface doesnt mean you have to
 use all the methods in it. thus abstractreadonlymodel.
 
 however, a lot of components manipulate items in the collection. you
 are right, they can do this without ever needing a setter, but it is
 very convenient to have a callback that lets you know that the
 collection has been updated. it is even more convenient to have a
 callback be part of model itself because in wicket you often factor
 out conversions and other transformations into the model
 implementation itself so they are reusable across multiple components.
 keep in mind models are the glue between components and your domain
 model, so if any kind of massaging needs to be done for the domain
 model to work smoothly with the component the model is the perfect
 place to do it.
 
 -igor
 
 On Sat, Mar 7, 2009 at 12:25 PM, Johannes Schneider
 maili...@cedarsoft.com wrote:
 
  i think misuse is a pretty bold word considering you are talking to
  people who designed and built imodel, dont you think? :)
 
  Well, I think you are right. Sorry for that.
  I just mean, that it has a bad smell here...
 
 
  if we do what you suggest then we would end up with:
 
  interface imodel { object getobject(); }
  interface icollectionmodel extends imodel { object convert(object); }
  interface iwhatevermodel extends imodel { void setobject(object); }
 
  then things that are built on top of imodel now have to be built on
  top of at least two hierarchies (imodel and iwhatevermodel -
  considering icollectionmodel can be a mixin which all implementations
  have to check for which makes it dirty), so we will end up with double
  the classes like loadabledetachablemodel, etc.
 
  Yes, I think we need at least two interfaces. I don't know whether we
  need the icollectionmodel... I think that can be discussed.
 
  where as right now this works perfectly and is quiet elegant:
 
  abstract class collectionconverternew,old implements 
  imodelcollectionnew {
private final imodelcollectionold delegate;
 
public collectionnew getobject() {
  listnew list=new arraylistnew(delegate.getobject().size());
  for (old o:delegate.getobject()) {
   list.add(converttonew(o));
  }
  return list;
}
 
public void setobject(collectionnew object) {
  delegate.getobject().clear();
  for (new o:object) {
   delegate.getobject().add(converttold(o));
  }
}
 
abstract new converttonew(old o);
abstract old converttoold(new o);
  }
 
  Don't know, whether that is really elegant. It feels more like a
  misuse... ;).
  I think there is a reason you don't simply take an object for everything
  (what might be the most elegant)...
 
  I really don't understand why IModel must handle the conversion stuff.
  That conversion thing could/should be done using some wrapper or
  something else. But I don't get all the concepts of Wicket.
  I just think that components that just *read* a collection, should just
  read the collection...
 
  But well, as you mentioned correctly, you have designed it, so it is
  your choice...
 
 
  Regards,
 
  Johannes
 
 
 
  -igor
 
  
   Regards,
  
   Johannes
  
   
-igor
   
On Wed, Mar 4, 2009 at 4:50 AM, Johannes Schneider
maili...@cedarsoft.com wrote:
 Hi,

 the concept of IModel seems to be very obvious. It is simply some 
 kind
 of reference and offers a getter and a setter.

 When used with ordinary object, everything works fine. An IModel that
 contains a String can easily be mapped to a TextField.
 The text field calls getObject to show the initial value and sets 
 the
 changed string to the model using setObject on form commit.


 Everything becomes a little more complicated when collections are
 affected. The problem is, that it is not obvious what those 
 collections
 represent.

 1) A collection might be read-only (e.g. the possible choices for a
 selection).
 2) But it also might be necessary to add/remove single elements (e.g.
 privileged users shown within a shuffle list).
 3) And sometimes the complete collection is changed (can't find an
 example here).


 IModel only supports the *third* method where the complete 
 collection is
 replaced.
 (Don't forget that the reference to the collection changes which will
 lead to several other problems.)
 I strongly recommend the usage of a wrapping 

Re: Security in a Spring Wicket layered application

2009-03-10 Thread Kent Larsson
Integrating with jSecurity instead is really a last resort. If it is
at all possible I wouldn't like to introduce more framework
dependencies. That integration project seems a bit early to use as
well, but it might be interesting in the future. Thanks for the link!

Regarding Spring Security (SS). Is anyone integrating Wicket with SS
on their own? I've read lots about SS now but I still find it hard to
see what I need for a Wicket application.

I got some tips at: http://wiki.apache.org/tapestry/Tapestry5AcegiNoAnnotations

But I still have lots of questions.
- In the above link they are using a link and passing the information
by GET. I would like to use POST, and I guess that shouldn't be a
problem. Tell me if you see some?
- I have to instruct SS to redirect a user to my own login page if
(s)he tries to access something which requires authentication. How is
that done?
- When a user registers an account I guess I should pass something on
to a servlet filter, similar to how authentication works?
- Which servlet filters do you think I'll need?

If I can just get someone to register and authenticate. Then I'll just
use the instructions in SS documentation to get GrantedAuthority
objects. I'll use these to show/hide things in Wicket pages as well as
enable/disable other things. Does that sound like a good approach?

If anyone has *any* tips I would be immensely greatful!! As I think
this is quite complex and I'm new to Spring Security.

Best regards,
Kent


On Mon, Mar 9, 2009 at 7:16 PM, Ryan McKinley ryan...@gmail.com wrote:
 I have not used it (yet), but check:
 http://code.google.com/p/wicket-jsecurity/



 On Mar 9, 2009, at 1:46 PM, Kent Larsson wrote:

 Hm, I had some problems. Are there any examples out there for this?

 On Mon, Mar 9, 2009 at 9:43 AM, Kent Larsson kent.lars...@gmail.com
 wrote:

 Hi,

 Great answer! :-) I'll try to do that today.

 Best regards, Kent


 On Sun, Mar 8, 2009 at 8:38 PM, Erik van Oosten e.vanoos...@grons.nl
 wrote:

 Hi Kent,

 Go with something that enables authorization in the service layer (e.g.
 Spring Security, jSecurity, ...).

 Next base your custom wicket authorization on the authentication store
 of
 the chosen base technology. Spring Security uses a thread local as
 authentication store and has a servlet filter to copy the authenticated
 user
 to/from the session so that the authenticated user is handily available
 during a request and properly stored afterwards.

 Authentication itself can be implemented from Wicket in a custom way
 (e.g. a
 username/password form). On success you just store the authenticated
 user in
 the authentication store.

 Regards,
  Erik.


 Kent Larsson wrote:

 Hi,

 I know there has been some discussion on this. But I've had a hard
 time deciding how this project should use security anyway.

 The application in question is layered into three layers for
 presentation, services and persistence using Wicket, Spring and
 Hibernate.

 What we need:
 - Authentication
 - Authorization on pages, components
 - Authorization before being able to run methods in the service layer
 - Authorization for viewing/editing some domain objects using Access
 Control List's (ACL's)

 I have read Wicket in Action and it's custom security solution has some
 pros:
 - It's quite easy to understand
 - We have a lot of freedom in how to do authentication and
 authorization

 And some cons:
 - I don't know how to authorize calls of specific methods, and thus
 - All security will be in the presentation layer
 - It won't be usable if we want security on web services later (which
 we do not need now, so maybe this can be disregarded)

 It would be nice if we could have a common solution to our security
 needs that integrates well with Wicket and Spring. I know that the
 Auth Roles project is out there as well as Swarm. But I don't know
 which will meet our needs and which will most likely be an option to
 us when we later move to Wicket 1.4 or a higher version.

 Best regards,
 Kent




 --
 Erik van Oosten
 http://www.day-to-day-stuff.blogspot.com/


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Security in a Spring Wicket layered application

2009-03-10 Thread Les Hazlewood
Hi Kent,

Although it is early, I am using the wicket-jsecurity integration in one of
my (big) projects.  It is working pretty well.  Feel free to ask questions -
I'm happy to help along the way.

Cheers,

Les
(JSecurity founder)

On Tue, Mar 10, 2009 at 1:42 PM, Kent Larsson kent.lars...@gmail.comwrote:

 Integrating with jSecurity instead is really a last resort. If it is
 at all possible I wouldn't like to introduce more framework
 dependencies. That integration project seems a bit early to use as
 well, but it might be interesting in the future. Thanks for the link!

 Regarding Spring Security (SS). Is anyone integrating Wicket with SS
 on their own? I've read lots about SS now but I still find it hard to
 see what I need for a Wicket application.

 I got some tips at:
 http://wiki.apache.org/tapestry/Tapestry5AcegiNoAnnotations

 But I still have lots of questions.
 - In the above link they are using a link and passing the information
 by GET. I would like to use POST, and I guess that shouldn't be a
 problem. Tell me if you see some?
 - I have to instruct SS to redirect a user to my own login page if
 (s)he tries to access something which requires authentication. How is
 that done?
 - When a user registers an account I guess I should pass something on
 to a servlet filter, similar to how authentication works?
 - Which servlet filters do you think I'll need?

 If I can just get someone to register and authenticate. Then I'll just
 use the instructions in SS documentation to get GrantedAuthority
 objects. I'll use these to show/hide things in Wicket pages as well as
 enable/disable other things. Does that sound like a good approach?

 If anyone has *any* tips I would be immensely greatful!! As I think
 this is quite complex and I'm new to Spring Security.

 Best regards,
 Kent


 On Mon, Mar 9, 2009 at 7:16 PM, Ryan McKinley ryan...@gmail.com wrote:
  I have not used it (yet), but check:
  http://code.google.com/p/wicket-jsecurity/
 
 
 
  On Mar 9, 2009, at 1:46 PM, Kent Larsson wrote:
 
  Hm, I had some problems. Are there any examples out there for this?
 
  On Mon, Mar 9, 2009 at 9:43 AM, Kent Larsson kent.lars...@gmail.com
  wrote:
 
  Hi,
 
  Great answer! :-) I'll try to do that today.
 
  Best regards, Kent
 
 
  On Sun, Mar 8, 2009 at 8:38 PM, Erik van Oosten e.vanoos...@grons.nl
  wrote:
 
  Hi Kent,
 
  Go with something that enables authorization in the service layer
 (e.g.
  Spring Security, jSecurity, ...).
 
  Next base your custom wicket authorization on the authentication store
  of
  the chosen base technology. Spring Security uses a thread local as
  authentication store and has a servlet filter to copy the
 authenticated
  user
  to/from the session so that the authenticated user is handily
 available
  during a request and properly stored afterwards.
 
  Authentication itself can be implemented from Wicket in a custom way
  (e.g. a
  username/password form). On success you just store the authenticated
  user in
  the authentication store.
 
  Regards,
   Erik.
 
 
  Kent Larsson wrote:
 
  Hi,
 
  I know there has been some discussion on this. But I've had a hard
  time deciding how this project should use security anyway.
 
  The application in question is layered into three layers for
  presentation, services and persistence using Wicket, Spring and
  Hibernate.
 
  What we need:
  - Authentication
  - Authorization on pages, components
  - Authorization before being able to run methods in the service layer
  - Authorization for viewing/editing some domain objects using Access
  Control List's (ACL's)
 
  I have read Wicket in Action and it's custom security solution has
 some
  pros:
  - It's quite easy to understand
  - We have a lot of freedom in how to do authentication and
  authorization
 
  And some cons:
  - I don't know how to authorize calls of specific methods, and thus
  - All security will be in the presentation layer
  - It won't be usable if we want security on web services later (which
  we do not need now, so maybe this can be disregarded)
 
  It would be nice if we could have a common solution to our security
  needs that integrates well with Wicket and Spring. I know that the
  Auth Roles project is out there as well as Swarm. But I don't know
  which will meet our needs and which will most likely be an option to
  us when we later move to Wicket 1.4 or a higher version.
 
  Best regards,
  Kent
 
 
 
 
  --
  Erik van Oosten
  http://www.day-to-day-stuff.blogspot.com/
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
  -
  To 

Re: PageExpiredException after mounting WebPage package

2009-03-10 Thread qssdy

Wow, your 1 line directed me to the problem.  That's awesome, thanks!

The problem turned out to be that we had put the HazelCast filter in front
of Wicket.  We haven't debugged what the interaction problem is, but
removing the HazelCast filter and sending requests directly to Wicket works.

Thanks again!
-- 
View this message in context: 
http://www.nabble.com/PageExpiredException-after-mounting-WebPage-package-tp22426042p22440036.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Security in a Spring Wicket layered application

2009-03-10 Thread James Carman
My wicket-advanced demo code integrates Spring Security and Wicket
using wicket-auth-roles:

http://svn.carmanconsulting.com/public/wicket-advanced/trunk/

The key is the SpringSecuritySession class:

http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/common/session/SpringSecuritySession.java


On Tue, Mar 10, 2009 at 1:42 PM, Kent Larsson kent.lars...@gmail.com wrote:
 Integrating with jSecurity instead is really a last resort. If it is
 at all possible I wouldn't like to introduce more framework
 dependencies. That integration project seems a bit early to use as
 well, but it might be interesting in the future. Thanks for the link!

 Regarding Spring Security (SS). Is anyone integrating Wicket with SS
 on their own? I've read lots about SS now but I still find it hard to
 see what I need for a Wicket application.

 I got some tips at: 
 http://wiki.apache.org/tapestry/Tapestry5AcegiNoAnnotations

 But I still have lots of questions.
 - In the above link they are using a link and passing the information
 by GET. I would like to use POST, and I guess that shouldn't be a
 problem. Tell me if you see some?
 - I have to instruct SS to redirect a user to my own login page if
 (s)he tries to access something which requires authentication. How is
 that done?
 - When a user registers an account I guess I should pass something on
 to a servlet filter, similar to how authentication works?
 - Which servlet filters do you think I'll need?

 If I can just get someone to register and authenticate. Then I'll just
 use the instructions in SS documentation to get GrantedAuthority
 objects. I'll use these to show/hide things in Wicket pages as well as
 enable/disable other things. Does that sound like a good approach?

 If anyone has *any* tips I would be immensely greatful!! As I think
 this is quite complex and I'm new to Spring Security.

 Best regards,
 Kent


 On Mon, Mar 9, 2009 at 7:16 PM, Ryan McKinley ryan...@gmail.com wrote:
 I have not used it (yet), but check:
 http://code.google.com/p/wicket-jsecurity/



 On Mar 9, 2009, at 1:46 PM, Kent Larsson wrote:

 Hm, I had some problems. Are there any examples out there for this?

 On Mon, Mar 9, 2009 at 9:43 AM, Kent Larsson kent.lars...@gmail.com
 wrote:

 Hi,

 Great answer! :-) I'll try to do that today.

 Best regards, Kent


 On Sun, Mar 8, 2009 at 8:38 PM, Erik van Oosten e.vanoos...@grons.nl
 wrote:

 Hi Kent,

 Go with something that enables authorization in the service layer (e.g.
 Spring Security, jSecurity, ...).

 Next base your custom wicket authorization on the authentication store
 of
 the chosen base technology. Spring Security uses a thread local as
 authentication store and has a servlet filter to copy the authenticated
 user
 to/from the session so that the authenticated user is handily available
 during a request and properly stored afterwards.

 Authentication itself can be implemented from Wicket in a custom way
 (e.g. a
 username/password form). On success you just store the authenticated
 user in
 the authentication store.

 Regards,
  Erik.


 Kent Larsson wrote:

 Hi,

 I know there has been some discussion on this. But I've had a hard
 time deciding how this project should use security anyway.

 The application in question is layered into three layers for
 presentation, services and persistence using Wicket, Spring and
 Hibernate.

 What we need:
 - Authentication
 - Authorization on pages, components
 - Authorization before being able to run methods in the service layer
 - Authorization for viewing/editing some domain objects using Access
 Control List's (ACL's)

 I have read Wicket in Action and it's custom security solution has some
 pros:
 - It's quite easy to understand
 - We have a lot of freedom in how to do authentication and
 authorization

 And some cons:
 - I don't know how to authorize calls of specific methods, and thus
 - All security will be in the presentation layer
 - It won't be usable if we want security on web services later (which
 we do not need now, so maybe this can be disregarded)

 It would be nice if we could have a common solution to our security
 needs that integrates well with Wicket and Spring. I know that the
 Auth Roles project is out there as well as Swarm. But I don't know
 which will meet our needs and which will most likely be an option to
 us when we later move to Wicket 1.4 or a higher version.

 Best regards,
 Kent




 --
 Erik van Oosten
 http://www.day-to-day-stuff.blogspot.com/


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



 

RE: Security in a Spring Wicket layered application

2009-03-10 Thread Kai Mütz
Kent Larsson mailto:kent.lars...@gmail.com wrote:
 Integrating with jSecurity instead is really a last resort. If it is
 at all possible I wouldn't like to introduce more framework
 dependencies. That integration project seems a bit early to use as
 well, but it might be interesting in the future. Thanks for the link!

 Regarding Spring Security (SS). Is anyone integrating Wicket with SS
 on their own? I've read lots about SS now but I still find it hard to
 see what I need for a Wicket application.

We are using Acegi and Wicket-auth-roles (1.3.5) similar to the WIKI
description:

http://cwiki.apache.org/WICKET/acegi-and-wicket-auth-roles.html

Have you read it?

But we do only:
- Authentication
- Authorization on pages, components

No Authorization on service layer. Are you interested in a small sample?

Cheers, Kai



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



using wasp/swarm + acegi and RunAs capability

2009-03-10 Thread novotny

Hi,

I'm currently using wicket security with acegi following the wicketstuff
documentation
http://wicketstuff.org/confluence/display/STUFFWIKI/Swarm+and+Acegi+HowTo.
WaspSession is subclasssed to provide authenticate and logoff methods that
use spring's AuthenticationManager and SecurityContextHolder classes. Now
however I have some admin pages and I need the capability for an admin to
run as a user. Has anyone had any experience with this? I'm sort of at a
loss to know where to begin-- I see that Spring has a RunAsManager
http://static.springframework.org/spring-security/site/reference/html/runas.html
 
but I'm not sure how to use it. Any help is greatly appreciated!

Thanks, Jason
-- 
View this message in context: 
http://www.nabble.com/using-wasp-swarm-%2B-acegi-and-RunAs-capability-tp22444906p22444906.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



AW: resource cacheable firefox/opera

2009-03-10 Thread Arthur Leigh Allen
the path is the same, the filename differs.
yes you're right, no-store and no-cache didn't change anything.
instead of Image i'm using NonCacheableImage as the subclass
and now it works fine with any browser.

but thanks for the hint

greetz
leigh




Von: Pointbreak pointbreak+wicketst...@ml1.net
An: Wicket Users Mailing List users@wicket.apache.org
Gesendet: Dienstag, den 10. März 2009, 16:15:15 Uhr
Betreff: Re: resource cacheable firefox/opera

You use the same url for different images? Firefox uses a memory cache
in addition to a disk cache. Check what headers are send with your
image. No-store and no-cache headers will NOT prevent firefox3 from
using its memory cache (at least not with pages). Your best bet is to
use different urls.

On Tue, 10 Mar 2009 14:56 +, Arthur Leigh Allen
arthurleigh.al...@yahoo.de wrote:
 Hi folks,
  
 I've implemented a RemoteImage class which extends the Image class.
 The method setCacheable works with Internet Explorer but neither with
 Firefox nor with Opera..
 If I load an image the first time, the correct image is shown.
 When I try to load a different image (path is applied correctly), the old
 image is shown.
 
 What I'm doing wrong?
 I'm using wicket 1.3.5.
  
 ===
 public
  classRemoteImage extendsImage {
     publicRemoteImage(String id, finalString path) {
         super(id);
     
         Resource resource = newWebResource() {
             publicIResourceStream getResourceStream() {
                 IResourceStream stream = newFileResourceStream(newFile(path));
                 returnstream;
             }
         };
  
         resource.setCacheable(false);
         setImageResource(resource);
     }
 }
  
 ===
  
 Would appreciate any help.
  
 Thanks in advance
 Leigh
 
 
      

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


  

Re: using wasp/swarm + acegi and RunAs capability

2009-03-10 Thread novotny

I just found SwitchUser in the Spring security code as well-- this seems to
be what I want, has anyone had any experience using it?

Thanks, Jason


novotny wrote:
 
 Hi,
 
 I'm currently using wicket security with acegi following the wicketstuff
 documentation
 http://wicketstuff.org/confluence/display/STUFFWIKI/Swarm+and+Acegi+HowTo.
 WaspSession is subclasssed to provide authenticate and logoff methods that
 use spring's AuthenticationManager and SecurityContextHolder classes. Now
 however I have some admin pages and I need the capability for an admin to
 run as a user. Has anyone had any experience with this? I'm sort of at a
 loss to know where to begin-- I see that Spring has a RunAsManager
 http://static.springframework.org/spring-security/site/reference/html/runas.html
  
 but I'm not sure how to use it. Any help is greatly appreciated!
 
 Thanks, Jason
 

-- 
View this message in context: 
http://www.nabble.com/using-wasp-swarm-%2B-acegi-and-RunAs-capability-tp22444906p22446728.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Putting an Ajax Callback in AjaxEventBehavior

2009-03-10 Thread danelav

I have an image with an onmouseup AjaxEventBehavior. This results in the
following markup:

lt;img id=M6 onmouseup=var
wcall=wicketAjaxGet('?wicket:interface=:0:lightBulbsBank:bankItems:1:image::IBehaviorListener:1:',null,null,
function() {return Wicket.$('M6') != null;}.bind(this)); ... /gt;

I want to put a JavaScript function into the second parameter of
wicketAjaxGet, which is currently null -- how do I get it there?
-- 
View this message in context: 
http://www.nabble.com/Putting-an-Ajax-Callback-in-AjaxEventBehavior-tp22448059p22448059.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AW: AW: Tabbed Panel with bookmarkable links

2009-03-10 Thread Brill Pappin
Yes, because you no longer have the previous state... I have the same  
problem, but maybe some ideas for a solution.


- Brill

On 10-Mar-09, at 11:25 AM, Christian Helmbold wrote:



Instead of competing, why don't we set up a project some place and  
check both

solutions in under different packages?
We can then refactor them into one and take the best of both :)


I agree. Is there an existing place in the wicket project to do this?

I've discovered some troubles in my solution when multiple tabbed  
panes are used in one page. The state of other panels is not hold  
correctly in the URLs and so the tabbed panels influence each other.






-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org