Re: Twenty Six Wicket Tricks

2009-07-28 Thread taha siddiqi
+1
26 Wicket Tricks or Wicket Cookbook or Wicket Recipes

(Whenever I am trying something new I always try a cookbook, It later
on acts as a reference too)

taha


On Wed, Jul 29, 2009 at 3:38 AM, Matej Knoppmatej.kn...@gmail.com wrote:
 On Tue, Jul 28, 2009 at 11:55 PM, Vladimir Kkoval...@gmail.com wrote:


 Matej Knopp-2 wrote:

 Modal Window is an ajax component. Submitting it with regular submit
 is not supported and it never was.


 But I would like to have AjaxFallbackModalWindow that survives page refresh.
 Why not author my own if the aims are different? Probably requirements we
 have are far from being accepted as common.
 Of course you can. There's nothing wrong with that.



 Again, modal window doesn't support regular submits (by design) so if
 you want to do file upload you'll have to use a hidden iframe or some
 other approach like that.


 IMO, Iframe is not an approach it is a work around the limitation (made by
 design) :)
 Yes. But from the beginning Modal Window was designed as Ajax Component.



 I just looked at jquery dialog example. The dialog is declared in
 markup but it is then reparented as top level DOM element. Same thing
 wicket modalwindow does.


 What is especial in my case is that the page height is limited by the window
 height and contains a srollable div within. Taking into account that the
 browsers we support works well with fixed positioning and assuming that the
 following excerpt works:



 Fixed positioning is a special case of absolute positioning. For fixed
 elements, the containing block is always taken to be the viewport of the
 browser window.
 This is true. Unfortunately it doesn't apply to IE6 which doesn't
 support position:fixed. Modal Window was written couple of years ago
 when IE6 position was quite strong, however even now we can't afford
 to ignore it. Unfortunately.


 It seems to be pretty doable. But it needs investigation. I haven't tried
 yet.
 Position:fixed will work in your case if you can afford to ignore IE6.
 But it's not something we can do in wicket extensions.



Anyway it is possible to do what the modal.js is doing by Wicket means and
don't have a component tree mismatch with DOM.

 Is it really? Mind sharing with me how?


 In case if the position:fixed does not help I would subclass a Form and make
 it a container of ModalWindows. Then by placing the
 modal-window-container-form at the body level I would acquire a new
 ModalWindow from the container. Does it make sense?

 So the ModalWindow would have to be added to the container (which I
 assume would have to be added to the page itself)? That's rather
 limiting.

 -Matej
 --
 View this message in context: 
 http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p24708596.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



Fwd: QuickCrud

2009-07-20 Thread taha siddiqi
Hi,

There are simple set of libraries I had thought of commenting properly
and sharing with the community but because of being busy with a few
projects I am unable to do that.

I don't know when I will get the time to properly comment, but until
then I would like to share this as-is code...

I have used it in two of my projects and it works for me...

It is located here

http://code.google.com/p/quickcrud/downloads/list


Sorry again for being lazy..

regards
Taha

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



Re: 1.4 is ready for production?

2009-07-20 Thread taha siddiqi
One of my projects has just gone into testing phase, I ported the
project from 1.35 to 1.4rc7 and I faced no problems.

Let us see how testing goes ...

Wassalam
Taha

On Tue, Jul 21, 2009 at 6:22 AM, Jeremy
Thomersonjer...@wickettraining.com wrote:
 Oops - sorry - pasted the wrong thing.  It does work.  I meant to send
 the URL - but it was just the original URL you sent.

 --
 Jeremy Thomerson
 http://www.wickettraining.com




 On Mon, Jul 20, 2009 at 7:51 PM, Jeremy
 Thomersonjer...@wickettraining.com wrote:
 Works for me:
 version `NSS_3.10' not found

 --
 Jeremy Thomerson
 http://www.wickettraining.com




 On Mon, Jul 20, 2009 at 5:07 PM, Steamussteam...@gmail.com wrote:

 M-m-m...

 May be it is some redirect problems?

 Try this:

 http://www.sport-pferde-portal.net/shglobal/home

 It is the same.

 I just cheked the site by using http://browsershots.org/

 Truly, I am puzzled, I got message - The server at
 www.sport-pferde-portal.de sent a HTTP redirect. Your web address has been
 updated. Please try again.

 But for URL above (http://www.sport-pferde-portal.net/shglobal/home) I got
 snapshots for my site from a lot of browsers (3 minutes ago). I can't
 explain it for this moment.





 aldaris wrote:

 Crash for me too:
 Mozilla/5.0 (X11; U; Linux x86_64; hu-HU; rv:1.9.1) Gecko/20090630
 Fedora/3.5-1.fc11 Firefox/3.5
 Maybe something locale-related stuff isn't working. Log files could be
 helpful to debug this.

 Peter

 2009-07-20 23:15 keltezéssel, Martin Makundi írta:
 Crashes or me, Mozilla/5.0 (Windows; U; Windows NT 5.1; fi;
 rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11

 **
 Martin

 2009/7/21 Carl-Eric Menzelcm.wic...@users.bitforce.com:
 On Tue, 21 Jul 2009 00:00:04 +0300
 Martin Makundimartin.maku...@koodaripalvelut.com  wrote:

 No. It crashes. Restart your browser and you will see.
 Works for me.

 Carl-Eric

 -
 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/1.4-is-ready-for-production--tp24572049p24578364.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



Re: Wicket Offline Applications

2009-05-04 Thread taha siddiqi
A popular Indian product FINACLE has an applet which kind of acts as a
fat client and each time a customer detail or scheme detail is fetched
the whole detail gets downloaded into the applet. But it is not an
pure offline application as only the current page can we viewed or
changed and every time you try to commit,  it searches for the
network.

May be it helps
taha


On Sun, May 3, 2009 at 10:34 PM, Carlo Camerino cmcamer...@gmail.com wrote:
 hmm,
 ya i guess you're right.
 -- further i would look into security of gears, how easy is it for
 -- someone to access the underlying data store?

 this will be the major issue.
 sad to say, i don't know how safe is this
 with the branch servers i'm safer.

 i don't really know how google gears plays out yet.
 thanks for all the inputs.

 On Mon, May 4, 2009 at 12:25 AM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:

 you already said each branch has their own server, so why not simply
 make this server sync to the central server when the connection is
 available.

 your argument for administering cost does not make sense as you are
 heading down the fat client path so instead of having a single server
 per branch to administer you will have every fat client app instance
 to administer.

 further i would look into security of gears, how easy is it for
 someone to access the underlying data store?

 -igor

 On Sun, May 3, 2009 at 4:35 AM, Carlo Camerino cmcamer...@gmail.com wrote:
  just to add, we don't have any plan of exposing this to the public (retail)
  but rather only to people within organization.
  so maybe we could have some sort of control.
  I don't know the implications of opening offline banking applications to 
  the
  public yet :P and i don't really see any usecase for this type of
  applications for now.
 
  btw, it's not that easy to target a larger set of people if you are using
  Fat Web clients.
  Just my two cents. bandwidht, cpu considerations, etc... maybe it depends 
  on
  your geographical location
 
  On Sun, May 3, 2009 at 7:27 PM, Carlo Camerino cmcamer...@gmail.com 
  wrote:
 
  There are really a lot of things i have to consider.
  Especially security.
 
  Here Are Some Of The Considerations I Guess
 
  1.) To View (Subset) Records But Not Edit Or Delete Them
  2.) Users must not be able to edit reference tables. Tables that are
  referenced by others.
  3.) Users must be able to enter transactions(Purely Insert,Transaction
  Recording Only) with client side validation and observance of limits and
  rules of course which were defined during online mode. ( Store This Queue
  Somewhere)
 
  I'm not reallyh sure that I want to go through with this however, this is
  just a prototype idea.
 
 
  On Sun, May 3, 2009 at 4:55 PM, Johan Compagner 
  jcompag...@gmail.comwrote:
 
  I cannot believe that a typical wicket application (and a banking app
  fall under that category) does well in offline mode, to me offline
  mode works if the app is just about personal data (like gmail for your
  email) because if that is not the case and loads of none peronal ==
  shared data is used, how are you pushing that to the client? Maybe if
  the data is not thah much (not very likely  in a banking app if you
  ask me) then you can push it to the client. But then when he gets
  online again you have to merge everything and resolve conflicts in the
  data...
 
  But wicket doesnt really play well for this at all. GWT or just
  another fat client like air or just java webstart would be better
 
  On 03/05/2009, Carlo Camerino cmcamer...@gmail.com wrote:
   hmm, you have a point here.however, every requirement is different.
  
   I know that it may sound weird, but still I believe that it depends on
  the
   nature of the application.
   There are lots of types of applications that banks use.
   Some I know would have to always have a central server managing it.
  
   There are different types of Technical Architectures that we cater for
  in
   our applications.
   There are some applicationms that always require online mode regardless
  adn
   there are applications that the user just
   needs to be able to view customer information ,etc
  
  
   actually it's hard to decide here.
   on the downside, I heard that GWT consumes a lot of resources on the
  client
   side, it's also a consideration.
  
   Failsafe servers are of course an option but again, the network is 
   still
  a
   factor here.
   For example a very slow connection to the central server makes my
   productivity a lot less.
   Some places suffer from low bandwidth, unreliable networks, etc...
  
   I saw the value of distributed or offline applications that uses
   synchronization.
   It will be harder for the developers of course sicne they have to cater
  to
   two modes.
   On Sun, May 3, 2009 at 1:55 PM, Vladimir K koval...@gmail.com wrote:
  
  
   I would install failsafe cluster rather satisfying every client 
   request
   about
   offline workability. You may end up 

Re: Does javascript:onload get executed on each ajax update ?

2009-05-02 Thread taha siddiqi
Found the answer

IHeaderResponse.renderOnDomReadyJavascript()

regards
Taha

On Sat, May 2, 2009 at 11:45 AM, taha siddiqi tawushaf...@gmail.com wrote:
 Hi All,

 I have to execute some code every time a form gets loaded. When I load
 the form in a non-ajax way it works but in an ajax call it fails to
 run the script.

 I have added an IHeaderContributor which contributes using
 TextTemplateHeaderContributor.forJavaScript.

 The script is uploaded on dom ready. Actually using jQuery $(function(){}

 Thanks in advance
 Taha


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



AjaxGoFilter

2009-03-22 Thread taha siddiqi
Hi

I was working on AjaxFallbackDataTable and FilterForm.

Although there is a GoFilter but there is no AjaxGoFilter. Am I
missing something here ?

Thankyou
taha

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



Re: Why are we top-posting...

2009-03-21 Thread taha siddiqi
Now you all get a gun and shoot me :)

I got your point

How many times 

No No No .. Enough 

This is a declaration 

I, TAHA, WILL NEVER SAY THAT TOP POSTING IS BAD OR BOTTOM POSTING IS GOOD

CLOSE THIS POST... PLEASE .

taha
(internally still a bottom-poster by heart)


On Sat, Mar 21, 2009 at 2:59 PM, Stephen Swinsburg
s.swinsb...@lancaster.ac.uk wrote:
 You read text from bottom to top?

 I thought this was dead and buried, people can post however they like and we
 are not going to conform to someone's 'standard'. Think of it this way, it's
 a mailing list where people write and read emails. How do you read and write
 your email? Pretty sure you'd hit a quick 'Reply' and type your message at
 the top like 99% of the rest of the world? Why change it for a mailing list?
 It's not designed so that one final post has every piece of information in
 it, that is what threads are for. What if someone erases part of the email
 when they reply? You'd be stuffed then!



 On 21/03/2009, at 5:50 AM, C. Bergström wrote:

 A: Because it messes up the order in which people normally read text.
 Q: Why is it such a bad thing?
 A: Top-posting.
 Q: What is the most annoying thing on usenet and in e-mail?

 -
 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: Just a little thank you

2009-03-20 Thread taha siddiqi
Me too

taha

On Sat, Mar 21, 2009 at 1:26 AM, Francisco Diaz Trepat - gmail
francisco.diaztre...@gmail.com wrote:
 once you go wicket you never go back...
 :-)

 I also want to adhere to the thanks for this great framework and all your
 help.

 f(t)

 On Fri, Mar 20, 2009 at 4:33 PM, Vit Rozkovec rozkovec...@email.cz wrote:

 Hallo,
 I just wanted to say a little thank you.
 I have a lot of gratitude towards people who made this framework and to the
 whole community. It is really pleasure to work with such nice and well
 thought framework, I really enjoy it. After spending some years with PHP,
 now, after a year and a half with wicket I see there is no way back. In this
 case I do not fear being dogmatic. Wicket, the only way :).

 Really, thank you.

 Vitek

 -
 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: Ajax Back Button

2009-03-16 Thread taha siddiqi
Thanks Jeremy,

My second question was

As we have a BASIC HTML version and Ajax Version of Gmail, How should
I implement the same in my application with least effort ?

 ( Where I live,  people do use the BASIC HTML version a lot :) )

taha


On Tue, Mar 17, 2009 at 2:26 AM, Jeremy Thomerson
jer...@wickettraining.com wrote:
 A simple Google search turns up several threads that almost all point back
 to here:
 https://issues.apache.org/jira/browse/WICKET-271

 Looks like it is planned for 1.5-m1 - and until then, you could look at how
 to implement it on your own (and provide patch ??)

 Not sure I understand your second question.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Mon, Mar 16, 2009 at 12:17 AM, taha siddiqi tawushaf...@gmail.comwrote:

 Hi,

 I have a panel filled application which has almost everything
 configured as AjaxFallback... Can I make the browser back button
 work... ( It seems I cannot )

 Also is it possible that I can have components configurable as Ajax or
 Basic Html,  so that I can have both Basic HTML version and Ajax
 Version...

 Thanks
 taha

 -
 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: Ajax Back Button

2009-03-16 Thread taha siddiqi
Thanks


On Tue, Mar 17, 2009 at 10:37 AM, Jeremy Thomerson
jer...@wickettraining.com wrote:
 You could create a second set of pages without all the complex components
 that take advantage of the same models, etc...  Code reuse, but separate the
 distinctly different parts.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Mon, Mar 16, 2009 at 11:37 PM, taha siddiqi tawushaf...@gmail.comwrote:

 Thanks Jeremy,

 My second question was

 As we have a BASIC HTML version and Ajax Version of Gmail, How should
 I implement the same in my application with least effort ?

  ( Where I live,  people do use the BASIC HTML version a lot :) )

 taha


 On Tue, Mar 17, 2009 at 2:26 AM, Jeremy Thomerson
 jer...@wickettraining.com wrote:
  A simple Google search turns up several threads that almost all point
 back
  to here:
  https://issues.apache.org/jira/browse/WICKET-271
 
  Looks like it is planned for 1.5-m1 - and until then, you could look at
 how
  to implement it on your own (and provide patch ??)
 
  Not sure I understand your second question.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Mon, Mar 16, 2009 at 12:17 AM, taha siddiqi tawushaf...@gmail.com
 wrote:
 
  Hi,
 
  I have a panel filled application which has almost everything
  configured as AjaxFallback... Can I make the browser back button
  work... ( It seems I cannot )
 
  Also is it possible that I can have components configurable as Ajax or
  Basic Html,  so that I can have both Basic HTML version and Ajax
  Version...
 
  Thanks
  taha
 
  -
  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: Why are we top-posting...

2009-03-15 Thread taha siddiqi
I have my arguments but it is your mailing list, so I have to abide by
the rules besides Martijn is my teacher ( Wicket in Action ) so can't
argue.. :)

Still came to know about 'Advantages of top posting', thanks everyone
for the response

- taha

On Mon, Mar 16, 2009 at 2:54 AM, Brill Pappin br...@pappin.ca wrote:
 chuckle

 This is an old argument that I've seen get pretty heated, but I haven't
 heard it mentioned since I used news groups for this sort of thing.
 Anyway -- What Martijn said...

 - Brill


 On 14-Mar-09, at 9:25 PM, taha siddiqi wrote:

 I was not expecting this... ( look I am also top posting ). All I
 wanted to say was MAY BE it is easy to
 read the archives that way.( MAY BE )

 Thanks anyways
 taha

 On Sun, Mar 15, 2009 at 12:54 AM, Martijn Dashorst
 martijn.dasho...@gmail.com wrote:

 Top posting is, has been and forever will be acceptable in this
 community. If you don't like that, you're free to bottom post,
 interleave post or not post at all. Nobody is forcing you to read this
 list, nobody will flame you when you bottom post. Just don't start
 telling us how to conduct our communications.

 I don't care what color the bikeshed is in and I'm not interested in
 what color you like, I just want to put my bike inside and get to
 work.

 Martijn

 On Sat, Mar 14, 2009 at 2:14 PM, taha siddiqi tawushaf...@gmail.com
 wrote:

 Hi,

 The story goes like this...

 Once I was brave enough to take on linux-kernal programming and joined
 a mailing list. My first post brought me a link which was not an
 answer to
 my question but an advice and today I feel we all need to look at it

 http://www.caliburn.nl/topposting.html

 Every time I try to read an archived mail to solve my problem I have
 to scroll the page up and down... Why don't we bottom-post to make our
 mails more readable and future proof

 HUMBLE REQUEST
 taha

 -
 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



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



Ajax Back Button

2009-03-15 Thread taha siddiqi
Hi,

I have a panel filled application which has almost everything
configured as AjaxFallback... Can I make the browser back button
work... ( It seems I cannot )

Also is it possible that I can have components configurable as Ajax or
Basic Html,  so that I can have both Basic HTML version and Ajax
Version...

Thanks
taha

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



Which version is stable

2009-03-14 Thread taha siddiqi
Hi,

Which version 1.3.x or 1.4.x should I use in production. Which one is
stable ? ( stupid question I know :) but I am confused )
I use 1.3.5, should I be using 1.4.x.

taha

-
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-14 Thread taha siddiqi
I was myself very much interested and finally I found

wicket-hibernate at
http://www.jroller.com/wireframe/entry/hibernateannotationcomponentconfigurator

and wicket-jpa at
http://perfbench.googlecode.com/svn/trunk/perfbench/wicket-jpa/

Then I came up which something that works for me ( already in the post )

taha


On Sat, Mar 14, 2009 at 6:16 PM, Will Jaynes wjay...@gmail.com wrote:
 In the archives, back in 2007, I see a lot of discussion about Hibernate/JPA
 validator and Wicket, but I can't find if there was any result from those
 discussions. Did anything come of it?

 Will

 On Tue, Mar 10, 2009 at 11:29 AM, taha siddiqi tawushaf...@gmail.comwrote:

 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

Why are we top-posting...

2009-03-14 Thread taha siddiqi
Hi,

The story goes like this...

Once I was brave enough to take on linux-kernal programming and joined
a mailing list. My first post brought me a link which was not an
answer to
my question but an advice and today I feel we all need to look at it

http://www.caliburn.nl/topposting.html

Every time I try to read an archived mail to solve my problem I have
to scroll the page up and down... Why don't we bottom-post to make our
mails more readable and future proof

HUMBLE REQUEST
taha

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



Re: Why are we top-posting...

2009-03-14 Thread taha siddiqi
I was not expecting this... ( look I am also top posting ). All I
wanted to say was MAY BE it is easy to
read the archives that way.( MAY BE )

Thanks anyways
taha

On Sun, Mar 15, 2009 at 12:54 AM, Martijn Dashorst
martijn.dasho...@gmail.com wrote:
 Top posting is, has been and forever will be acceptable in this
 community. If you don't like that, you're free to bottom post,
 interleave post or not post at all. Nobody is forcing you to read this
 list, nobody will flame you when you bottom post. Just don't start
 telling us how to conduct our communications.

 I don't care what color the bikeshed is in and I'm not interested in
 what color you like, I just want to put my bike inside and get to
 work.

 Martijn

 On Sat, Mar 14, 2009 at 2:14 PM, taha siddiqi tawushaf...@gmail.com wrote:
 Hi,

 The story goes like this...

 Once I was brave enough to take on linux-kernal programming and joined
 a mailing list. My first post brought me a link which was not an
 answer to
 my question but an advice and today I feel we all need to look at it

 http://www.caliburn.nl/topposting.html

 Every time I try to read an archived mail to solve my problem I have
 to scroll the page up and down... Why don't we bottom-post to make our
 mails more readable and future proof

 HUMBLE REQUEST
 taha

 -
 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



Re: Trying Hibernate Validator Integration

2009-03-14 Thread taha siddiqi
I actually used it as a listener and at component level in my project.

I will try to add this feature to it..

Thanks
taha

On Sun, Mar 15, 2009 at 10:17 AM, Will Jaynes w...@jaynes.org wrote:
 Taha, I've tried playing with  your HibernateValidator. It seems necessary
 to add it to each form field. If I add it simply to the form, the validation
 behavior doesn't happen. Am I missing something?
 Will

 On Sat, Mar 14, 2009 at 9:06 AM, taha siddiqi tawushaf...@gmail.com wrote:

 I was myself very much interested and finally I found

 wicket-hibernate at

 http://www.jroller.com/wireframe/entry/hibernateannotationcomponentconfigurator

 and wicket-jpa at
 http://perfbench.googlecode.com/svn/trunk/perfbench/wicket-jpa/

 Then I came up which something that works for me ( already in the post )

 taha


 On Sat, Mar 14, 2009 at 6:16 PM, Will Jaynes wjay...@gmail.com wrote:
  In the archives, back in 2007, I see a lot of discussion about
 Hibernate/JPA
  validator and Wicket, but I can't find if there was any result from those
  discussions. Did anything come of it?
 
  Will
 
  On Tue, Mar 10, 2009 at 11:29 AM, taha siddiqi tawushaf...@gmail.com
 wrote:
 
  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

Re: Trying Hibernate Validator Integration

2009-03-14 Thread taha siddiqi
in your Application::init();

addComponentOnBeforeRenderListener( new HIbernateValidator() );

This will add validators to every @Entity | @Embeddable properties
using Hibernate validators
which are acting as CompoundModel()'s Objects in a Form

taha

On Sun, Mar 15, 2009 at 11:03 AM, Will Jaynes w...@jaynes.org wrote:
 I guess I'm not sure what you mean. Can you please show a code snippet?

 On Sun, Mar 15, 2009 at 1:04 AM, taha siddiqi tawushaf...@gmail.com wrote:

 I actually used it as a listener and at component level in my project.

 I will try to add this feature to it..

 Thanks
 taha

 On Sun, Mar 15, 2009 at 10:17 AM, Will Jaynes w...@jaynes.org wrote:
  Taha, I've tried playing with  your HibernateValidator. It seems
 necessary
  to add it to each form field. If I add it simply to the form, the
 validation
  behavior doesn't happen. Am I missing something?
  Will
 
  On Sat, Mar 14, 2009 at 9:06 AM, taha siddiqi tawushaf...@gmail.com
 wrote:
 
  I was myself very much interested and finally I found
 
  wicket-hibernate at
 
 
 http://www.jroller.com/wireframe/entry/hibernateannotationcomponentconfigurator
 
  and wicket-jpa at
  http://perfbench.googlecode.com/svn/trunk/perfbench/wicket-jpa/
 
  Then I came up which something that works for me ( already in the post )
 
  taha
 
 
  On Sat, Mar 14, 2009 at 6:16 PM, Will Jaynes wjay...@gmail.com wrote:
   In the archives, back in 2007, I see a lot of discussion about
  Hibernate/JPA
   validator and Wicket, but I can't find if there was any result from
 those
   discussions. Did anything come of it?
  
   Will
  
   On Tue, Mar 10, 2009 at 11:29 AM, taha siddiqi tawushaf...@gmail.com
  wrote:
  
   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

Re: DataView Model

2009-03-11 Thread taha siddiqi
I had a similar problem but then i found I was not adding a model to
the components i was adding in my listview.populateItem()

may be it helps..
taha

On Thu, Mar 12, 2009 at 2:20 AM, Douglas Ferguson
doug...@douglasferguson.us wrote:
 Yeah.. but, why would get/set be called on a dataview?
 The strange thing is that it was barfing like this before.

 Douglas

 -Original Message-
 From: Linda van der Pal [mailto:lvd...@heritageagenturen.nl]
 Sent: Wednesday, March 11, 2009 10:24 AM
 To: users@wicket.apache.org
 Subject: Re: DataView  Model

 Did you use a CompoundPropertyModel on the page? If so, that would
 explain why it was looking for a setter with the name of the DataView.

 Linda.

 Douglas Ferguson wrote:
 I just started using some code that was retired for awhile, so I'm not sure 
 what all changed around it and the behavior I'm seeing is really strange.

 I have a DataView on my page and wicket is complain that my model object 
 doesn't have a getter for the id of the DataView.
 I.E. DataView is called alternateWebsites and wicket is complaining that 
 the model object doesn't have getAleternateWebsites.

 I'm confused as to what change would make a DataView itself call set/get 
 Model???
 I'm also confused how the compound property model is even getting attached 
 to the DataView.

 I was able to fix this with a setModel(new Model()) on the dataView. But 
 that seems awefully hackish.

 Douglas


 


 No virus found in this incoming message.
 Checked by AVG - www.avg.com
 Version: 8.5.278 / Virus Database: 270.11.10/1994 - Release Date: 03/10/09 
 19:51:00




 -
 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



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

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

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

2009-03-07 Thread taha siddiqi
Sorry for a late response!! In this part of the world interest works
5-6 hours a day if you are fortunate and yesterday i was not...

Man, It is my pleasure to be part of a project which made me most
comfortable with j2ee ( I have worked from perl, php, python, asp to
.NET, struts, spring MVC ). Hope I will be able to contribute to this
project in a few months ... ( right now i am busy with two office
projects )

Thanks everybody

taha

On Fri, Mar 6, 2009 at 8:11 PM, Leszek Gawron lgaw...@apache.org wrote:
 taha siddiqi wrote:

 Thanks!!( everyone MADE a joke and I BECAME one )

 I'm sorry if you felt offended. It wasn't personal. Maybe my expression was
 not exact enough. After all I have used your proposal (modify Strings
 directly in domain model). What I didn't like is the requirement to change
 every set*( String value ) so I used AspectJ for that (which is probably a
 total overkill).

 My regards
        lg
 --
 Leszek Gawron

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

2009-03-06 Thread taha siddiqi
Thanks!!( everyone MADE a joke and I BECAME one )

On Fri, Mar 6, 2009 at 3:55 PM, Leszek Gawron lgaw...@apache.org wrote:
 I've been out for one day. I come back and see a thread with 38 messages.
 That's crazy !:)

 jWeekend wrote:

 Leszek,

 Thank you asking such a deep question ;-)
 We may not all agree, but in the end, at least you have been offered
 around
 87 well-intentioned solutions you can ask your customer to choose from;
 that
 will teach them to request such complex features and fuctionality!

 I was really blown by the amount of approaches you all presented. Thank you
 for all of them.

 Some answers:

 1. Dave wrote:

 A slightly different approach: I would talk with the customer again,
 because this is a really stupid (excusez le mot) requirement. I hope you
 understand their motivation, possibly some legacy system that depends on
 uppercase information? Maybe the problem can be shifted to that legacy
 system that uppercases all data read from the database?

 I thought so too but actually it's not that stupid after all. The customer
 has to enter A LOT of names, addresses etc. It speeds things up not to have
 to think about Proper Word Capitalization. Anything you type in always looks
 good.

 2. I wanted to go with most non invasive way to do it. That is why I like:

 public class UpperCaseBehavior extends AttributeAppender
 {
   private static final long serialVersionUID = 1L;

   public UpperCaseBehavior()
   {
       super(style, new ModelString(text-transform: uppercase), ;);
   }

   @Override
   public void bind(Component component)
   {
       super.bind(component);
       component.add(new AttributeAppender(
           onkeyup, new ModelString(this.value =
 this.value.toUpperCase()), ;));
   }
 }


 especially used with some nasty logic that would apply the behavior to every
 string field.

 This is why I find this:

 public void setFoo(String foo) {
  this.foo = foo == null ? null : foo.toUpperCase();
 }

 really ugly. Remember that I have to apply this for 99% of my domain model.

 3. Igor, will this work:

 class uppercasetextfield extends textfieldstring {
        public void updatemodel()
        {
              final String str=getconvertedinput();
              setdefaultmodelobject((str==null)?null:str.touppercase());
        }
 }

 If the form model is a loadable detachable model?


 The solution I chose:

 @UpperCased
 @Entity
 @Table(name = usr)
 @Inheritance(strategy = InheritanceType.JOINED)
 public class User extends Persistent {
        private boolean         active  = true;
        private String          code;

       �...@normalcased
        private String          username;

       �...@normalcased
        private String          password;
        private String          firstName;
        private String          lastName;
        private SetRole       roles   = new HashSetRole();
        private String          mobilePhone;
        private String          workPhone;
        private String          colour;

 }

 and:

 public aspect Uppercaser {
        pointcut setString( String value ) : ( ( set(String (@UpperCased
 *).* )  set(!...@normalcased String *.* ) )

      || set(@UpperCased String *.* ) )

       args( value );

        void around( String value ) : setString( value ) {
                proceed( StringUtils.upperCase( value ) );
        }
 }

 because:

 1. I decided that the uppercasing should available for junit tests/command
 line tools etc.
 2. It introduces the least changes into existing code.
 3. It allows me to get rid of uppercasing just by recompiling the domain
 model library without the aspect (if ever my customer came back to
 sanity).

 It feels like I'm introducing way too complicated tool to solve an easy task
 (maybe judging by the number of the posts - not that easy after all), but
 what the hell...


 Thank you for all posts. You are by no means one of the most helpful and
 vigorous OS community there is.

 PS. I laughed almost to tears reading some posts. Very refreshing :)

 --
 Leszek Gawron 3.14159265358979323846264338327950288419716939937510
 58209749445923078164062862089986280348253421170679
 82148086513282306647093844609550582231725359408128
 48111745028410270193852110555964462294895493038196
 44288109756659334461284756482337867831652712019091
 45648566923460348610454326648213393607260249141273
 72458700660631558817488152092096282925409171536436
 78925903600113305305488204665213841469519415116094
 33057270365759591953092186117381932611793105118548
 07446237996274956735188575272489122793818301194912
 98336733624406566430860213949463952247371907021798
 60943702770539217176293176752384674818467669405132
 00056812714526356082778577134275778960917363717872
 14684409012249534301465495853710507922796892589235
 42019956112129021960864034418159813629774771309960
 5187072113499837297804995105973173281609631859
 50244594553469083026425223082533446850352619311881
 71010003137838752886587533208381420617177669147303
 

Re: how to save validated fields in a form even if entire form still needs work

2009-03-04 Thread taha siddiqi
Take a look at IFormValidator.

taha

On Thu, Mar 5, 2009 at 7:31 AM, novotny novo...@gridsphere.org wrote:

 Hi,

 I have a form with 8 required fields. I'd like it if even if they just fill
 out 4 of the fields, I can go ahead and persist those field answers to the
 database and still remind them to fill out the remaining fields. What is the
 hook method that I override to persist the valid fields?

 Thanks, Jason
 --
 View this message in context: 
 http://www.nabble.com/how-to-save-%22validated%22-fields-in-a-form-even-if-entire-form-still-needs-work-tp22343848p22343848.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



Re: Uppercasing inputs

2009-03-04 Thread taha siddiqi
Hi

I have to agree with Jeremy. I would change the domain model and in
case i must do it in Wicket I will use I will try to configure a
Listener for a general purpose uppercase behavior

taha

On Thu, Mar 5, 2009 at 7:26 AM, James Carman
jcar...@carmanconsulting.com wrote:
 On Wed, Mar 4, 2009 at 6:29 PM, Jeremy Thomerson
 jer...@wickettraining.com wrote:
 LOL!  Nah - I would just change all the setters on every domain object to
 be:

 public void setFoo(String foo) {
  this.foo = foo == null ? null : foo.toUpperCase();
 }

 Or, maybe I'd use AOP and build an aspect that could automatically intercept
 calls to com.mydomain setters that take a single string argument and do the
 upper-casing there!

 Instead of doing it on *all* single-string argument methods, you could
 annotate the parameters:

 public void setFoo(@Upcase String foo)
 {
  this.foo = foo;
 }

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

2009-03-04 Thread taha siddiqi
I still feel changing to uppercase in domain model gives you the
flexibility of the changing the values in any layer of the application

taha


On Thu, Mar 5, 2009 at 10:02 AM, Jeremy Thomerson
jer...@wickettraining.com wrote:
 Oh, actually, just for the record, I was kidding about that.  That was my
 facetious / sarcastic tone that unfortunately doesn't come through all that
 well in email (although Igor picked it up).  But, more power to you - there
 are certainly plenty of options!

 --
 Jeremy Thomerson
 http://www.wickettraining.com

 On Wed, Mar 4, 2009 at 10:30 PM, taha siddiqi tawushaf...@gmail.com wrote:

 Hi

 I have to agree with Jeremy. I would change the domain model and in
 case i must do it in Wicket I will use I will try to configure a
 Listener for a general purpose uppercase behavior

 taha

 On Thu, Mar 5, 2009 at 7:26 AM, James Carman
 jcar...@carmanconsulting.com wrote:
  On Wed, Mar 4, 2009 at 6:29 PM, Jeremy Thomerson
  jer...@wickettraining.com wrote:
  LOL!  Nah - I would just change all the setters on every domain object
 to
  be:
 
  public void setFoo(String foo) {
   this.foo = foo == null ? null : foo.toUpperCase();
  }
 
  Or, maybe I'd use AOP and build an aspect that could automatically
 intercept
  calls to com.mydomain setters that take a single string argument and do
 the
  upper-casing there!
 
  Instead of doing it on *all* single-string argument methods, you could
  annotate the parameters:
 
  public void setFoo(@Upcase String foo)
  {
   this.foo = foo;
  }
 
  -
  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



DropDownChoice and Large Models

2009-03-04 Thread taha siddiqi
Hi,

DropDownChoice is used to hold a list of models which are then used
for choosing a single model. What if the model is very large and I
only want id/name combination to be used as a list of models and the
use the choosen id to get the actual selected Model. The catch here is
that I want to use two different types of models, one for the list and
other for the DropDownChoice's model.

I hope I was to be explain my problem!!

regards
tawus

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



Re: Where to disable a child component

2009-02-20 Thread taha siddiqi
Thanks for the response,

That is also a way of doing it but I have too many child components
and it is easy to
just write something like

@Override
protected void onRender( MarkupStream stream ){
   childComponent1.setEnabled( isEnabled() );
   
}

tawus

On Fri, Feb 20, 2009 at 9:44 PM, Jeremy Thomerson
jer...@wickettraining.com wrote:
 Why not let you child components override isEnabled() and have part of the
 logic in it check if their parent is enabled?

 On Thu, Feb 19, 2009 at 11:25 PM, taha siddiqi tawushaf...@gmail.comwrote:

 Hi,

 I think I resolved it.  I used FormComponentPanel.onRender( MarkupStream )

 regards
 tawus

 On Fri, Feb 20, 2009 at 10:42 AM, taha siddiqi tawushaf...@gmail.com
 wrote:
  Hi,
 
  I have a FormComponentPanel with child components and i need to
  disable the children when FormComponentPanel is disabled( isEnabled()
  == false ).
  I can do that in onBeforeRender() but the problem is that I have to
  take the decision on whether to disable the FormComponentPanel in my
  IComponentOnBeforeRenderListener.beforeRender() and as this function
  is called after FormComponentPanel.onBeforeRender() I am not able
  to disable the child components.
 
  Please help
 
  thanks in advance
  tawus
 

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




 --
 Jeremy Thomerson
 http://www.wickettraining.com


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



Re: how to hide parameter in URL? for parameters

2009-02-19 Thread taha siddiqi
use a post request !!

tawus

On Thu, Feb 19, 2009 at 2:31 PM, wch2001 wch2...@hotmail.com wrote:


 Dear all,

 I am doing a project , there is one url with some parameters  as below

 http://localhost:8080/dira/?wicket:bookmarkablePage=%3Asg.sphsearch.dira.web.wicket.pages.company.CompanyDetailoriginPage=companyorganizationId=191834

 If I set mountBookmarkablePage in webApplication for CompanyDetail like
 that:
 mountBookmarkablePage(/company, CompanyDetail.class);

 The url will be changed to

 http://localhost:8080/dira/company/originPage/company/organizationId/191834/

 how Can I hide the parameters? like
 http://localhost:8080/dira/company

 thanks

 wch
 --
 View this message in context: 
 http://www.nabble.com/how-to-hide-parameter-in-URL--for-parameters-tp22096367p22096367.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



Re: How to deal with dynamic form issue

2009-02-19 Thread taha siddiqi
Hi,

Can I use input type='hidden' in wicket to sort out the issue
( I saw a post stating hidden is something which is not part of wicket
philosophy. )

regards
tawus

On Thu, Feb 19, 2009 at 12:25 PM, taha siddiqi tawushaf...@gmail.com wrote:
 Hi,

 I am stuck with a form where in I have to add new form elements
 dynamically in javascript.
 My Form contains an option to select the number of guests and then I
 add to the form(in javascript) 'select elements' to select the ages of
 the guests.
 How will I deal with it in wicket.

 I can do this using ajax( ListView technique ) but how to do this in
 javascript..

 regards
 Tawus


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



Where to disable a child component

2009-02-19 Thread taha siddiqi
Hi,

I have a FormComponentPanel with child components and i need to
disable the children when FormComponentPanel is disabled( isEnabled()
== false ).
I can do that in onBeforeRender() but the problem is that I have to
take the decision on whether to disable the FormComponentPanel in my
IComponentOnBeforeRenderListener.beforeRender() and as this function
is called after FormComponentPanel.onBeforeRender() I am not able
to disable the child components.

Please help

thanks in advance
tawus

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



Re: Where to disable a child component

2009-02-19 Thread taha siddiqi
Hi,

I think I resolved it.  I used FormComponentPanel.onRender( MarkupStream )

regards
tawus

On Fri, Feb 20, 2009 at 10:42 AM, taha siddiqi tawushaf...@gmail.com wrote:
 Hi,

 I have a FormComponentPanel with child components and i need to
 disable the children when FormComponentPanel is disabled( isEnabled()
 == false ).
 I can do that in onBeforeRender() but the problem is that I have to
 take the decision on whether to disable the FormComponentPanel in my
 IComponentOnBeforeRenderListener.beforeRender() and as this function
 is called after FormComponentPanel.onBeforeRender() I am not able
 to disable the child components.

 Please help

 thanks in advance
 tawus


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



How to deal with dynamic form issue

2009-02-18 Thread taha siddiqi
Hi,

I am stuck with a form where in I have to add new form elements
dynamically in javascript.
My Form contains an option to select the number of guests and then I
add to the form(in javascript) 'select elements' to select the ages of
the guests.
How will I deal with it in wicket.

I can do this using ajax( ListView technique ) but how to do this in
javascript..

regards
Tawus

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



Re: Avoid serialization troubles with static members

2009-02-18 Thread taha siddiqi
I agree with John Krasnay

I am new to wicket( 2 months old) but I find @SpringBean very easy to
use and it minimizes the spring-context concern while developing the
application.

and I think avoiding annotations is something you wont be able to do for long..

tawus



On Wed, Feb 18, 2009 at 11:36 PM, John Krasnay j...@krasnay.ca wrote:
 On Wed, Feb 18, 2009 at 04:45:26PM +, Christian Helmbold wrote:
 I've read http://cwiki.apache.org/WICKET/spring.html and the corresponding 
 section in Wicket in Action about the troubles with serialization of 
 injected services.

 Dependencies often have references to other dependencies in the
 container, and so if one is serialized it will probably serialize a few
 others and can possibly cascade to serializing the entire container.
 (http://cwiki.apache.org/WICKET/spring.html)

 As
 far as I understand this is not a dependency injection specific issue.
 In either case all referenced objects are serialized recursively. So I
 think I have to take care about serialization not only when using
 Spring or Guice.

 Wouldn't it be sufficient to use a static member to hold a reference to a 
 service? i.e.

 public class SomeWicketComponent{
   private static MyService service;
   // ...
 }


 How would you intialize these? Would you have a static getter, and force
 yourself to remember to always use it? Or would you have a static setter
 and centralize the initialization code somewhere else? Either way sounds
 ugly to me.

 Remains
 the problem with the injection. To solve this the mentioned website
 suggests several ways. The Application Object Approach seems to be most
 wicket like to me. But as mentioned there it is very verbose. Why not
 simply insert a  method to deliver requested beans into the Application
 class? It would look like this:

 class MyApplication extends WebApplication {
private ApplicationContext ctx = new ClassPathXmlContext(context.xml); 
 // Spring context
public Object getBean(String beanName){
return ctx.getBean(beanName);
}
 }

 Is
 anything wrong with it?

 The problem is you'll end up with code like this sprinkled throughout
 your app:

  MyService svc = (MyService) MyApp.getBean(myService);

 Let's see, where to start...

 - it's ugly
 - the cast and the bean name can fail in a way that is only detectable
  at runtime
 - it ties all your components to your application class
 - it's difficult to test, since you need to mock up a MyApp instance for
  your component to work

 I find it much more elegant than to store a
 reference for each bean in in the application class as suggested on 
 http://cwiki.apache.org/WICKET/spring.html#Spring-ApplicationObjectApproach.


 I don't find either very elegant.

 Maybe the annotation-based approach is a bit more elegant but I don't like 
 annotations much.


 What don't you like about them? Annotations are a tool just like any
 other part of the language. A carpenter doesn't use a brick because he
 doesn't like hammers much.

 It
 seems to me, that dependency injection (DI) and wicket is not a dream
 team. Do you use DI with Wicket or do you use the classic approach
 like Wicket itself does?


 I've been very happy with @SpringBean so far.

 jk

 -
 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



Where can i find ResourceBundle

2009-01-28 Thread taha siddiqi
Hi everyone,

I am using Hibernate's ClassValidator and one of its constructors requires a

java.util.ResourceBundle to be given as a parameter, how can i attach
the wicket resource stream to it


Thanks in advance

regards
Tawus

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



Where can i find ResourceBundle

2009-01-28 Thread taha siddiqi
Hi everyone,

I am using Hibernate's ClassValidator and one of its constructors requires a

java.util.ResourceBundle to be given as a parameter, how can i attach
the wicket resource stream to it


Thanks in advance

regards
Tawus

I tried to google but couldn't find any thing

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



Need for a annotation based validation

2009-01-24 Thread taha siddiqi
Hi everyone,

The validation provided by wicket is sufficient but I feel that if we
integrate it will EJB Persistence Domain Objects, it will be very easy
to
validate and duplication of code can be avoided.

Any comments !!

regards
taha

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



Re: Need for a annotation based validation

2009-01-24 Thread taha siddiqi
On Sat, Jan 24, 2009 at 11:13 PM,  igor.vaynb...@gmail.com wrote:
 There is a project that does this in wicketstuff. Hibernate-validator I 
 believe.

 -igor

 On 1/24/09, taha siddiqi tawushaf...@gmail.com wrote:
 Hi everyone,

 The validation provided by wicket is sufficient but I feel that if we
 integrate it will EJB Persistence Domain Objects, it will be very easy
 to
 validate and duplication of code can be avoided.

 Any comments !!

 regards
 taha

 -
 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



I know but shouldn't this be part of the core project ?

regards
Taha

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



Re: Need for a annotation based validation

2009-01-24 Thread taha siddiqi
On Sun, Jan 25, 2009 at 10:00 AM, Peter Thomas ptrtho...@gmail.com wrote:
 Yep.  Also integrating Hibernate Validator can be done in just a few lines
 of code, see this for an example (line 87):

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

 On Sun, Jan 25, 2009 at 9:45 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 wicket is a web application framework. integrating with hibernate is
 outside its core functionality.

 -igor

 On Sat, Jan 24, 2009 at 5:59 PM, taha siddiqi tawushaf...@gmail.com
 wrote:
  On Sat, Jan 24, 2009 at 11:13 PM,  igor.vaynb...@gmail.com wrote:
  There is a project that does this in wicketstuff. Hibernate-validator I
 believe.
 
  -igor
 
  On 1/24/09, taha siddiqi tawushaf...@gmail.com wrote:
  Hi everyone,
 
  The validation provided by wicket is sufficient but I feel that if we
  integrate it will EJB Persistence Domain Objects, it will be very easy
  to
  validate and duplication of code can be avoided.
 
  Any comments !!
 
  regards
  taha
 
  -
  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
 
 
 
  I know but shouldn't this be part of the core project ?
 
  regards
  Taha
 
  -
  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




Hi,

I got the point... Thanks

I also found this

http://markmail.org/message/xers65c2hewper3c?q=wicket+hibernate+validatorpage=1refer=ppkahldf4szemm5t

taha

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



Hibernate and SortableDataProvider

2009-01-22 Thread taha siddiqi
Hi everybody,

I wonder which one is a better way of loading data into a DefaultDataTable

1. using iterator() in SortableDataProvider to load all the id's of
objects only and then using model to load actual objects
2. loading full objects using iterator()

regards
Tawus

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



Re: Hibernate and SortableDataProvider

2009-01-22 Thread taha siddiqi
Thanks,

I had earlier used only id's but then I was thinking of shifting to this model.

On Fri, Jan 23, 2009 at 12:30 PM, Frank Klein Koerkamp
fkleinkoerk...@educator.eu wrote:
 Hi,

 The best i think to load full objects once. And put it in an loadable
 detachablemodel. In this model save id of object. Implement the load
 function, this will retrieve the object from hibrnate via id. Also see
 example in wicket in action.

 Regards,

 Frank

 Verstuurd vanaf mijn iPhone

 Op 23 jan 2009 om 07:17 heeft taha siddiqi tawushaf...@gmail.com
 het volgende geschreven:\

 Hi everybody,

 I wonder which one is a better way of loading data into a
 DefaultDataTable

 1. using iterator() in SortableDataProvider to load all the id's of
 objects only and then using model to load actual objects
 2. loading full objects using iterator()

 regards
 Tawus

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


 The information contained in this communication is confidential, intended 
 solely for the use of the individual or entity to whom it is addressed and 
 may be legally privileged and protected by professional secrecy. Access to 
 this message by anyone else is unauthorized. If you are not the intended 
 recipient, any disclosure, copying, or distribution of the message, or any 
 action or omission taken by you in reliance on it is prohibited and may be 
 unlawful. Please immediately contact the sender if you have received this 
 message in error. This email does not constitute any commitment from Cordys 
 Holding BV or any of its subsidiaries except when expressly agreed in a 
 written agreement between the intended recipient and Cordys Holding BV or its 
 subsidiaries. Cordys is neither liable for the proper and complete 
 transmission of the information contained in this communication nor for any 
 delay in its receipt. Cordys does not guarantee that the integrity of this 
 communication has been maintained nor that the communication is free of 
 viruses, interceptions or interference. If you are not the intended recipient 
 of this communication please return the communication to the sender and 
 delete and destroy all copies.

 -
 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