how to inject arbitrary javascript code to a component markup?

2009-10-10 Thread Paul Huang
Suppose I write my own wicket component called XYZ that have the following markup wicket:panel div wicket:id=id_xxx /div /wicket:panel How can I inject some js code into this markup so when it's rendered in a page, I got something like wicket:panel div wicket:id=id_xxx script

Client-side treeView

2009-10-06 Thread Paul Huang
Hello, I would like show a treeview like the following, root |---dir1 ||leave 1.1 ||leave 1.2 |-leave 0. 1 |-leave 0.2 This view should also allow a user to select multiple leave nodes (think of selecting multiple catagories to charaterized a product). I checked

ProgressBar demo doesn't work for firefox 3.5.3

2009-10-02 Thread Paul Huang
I copy and paste the single file upload demo at http://www.wicket-library.com/wicket-examples/upload/single; to my local machine and found the the ajax progressbar doesn't work on my firefox 3.5.3 on winxp. But It works on my ie 8 though. Any idea what might be the cause? ( I did not change a

Re: User name validation - how to check database to find if a name has already been taken?

2009-09-30 Thread Paul Huang
igor.vaynberg wrote: form { onsubmit() { try { users.persist(getmodelobject()); } catch (usernamealreadyexistsexception e) { error(error.username.exists); } } } -igor Thanks, it works like a charm. I did not know I could show an

Re: User name validation - how to check database to find if a name has already been taken?

2009-09-30 Thread Paul Huang
The AbstractValidator approach is fine, or you can do it the shorter way the Igor showed. Either way, when the page that has the username is submitted, you're going to have to write that record to the database, even if you don't have all the info. The way you wrote the question, I presume

User name validation - how to check database to find if a name has already been taken?

2009-09-25 Thread Paul Huang
Hello, I would like to get your suggestion about how to validate a user name input by checking if the name has already been taken (exists in the back-end database); and how to show feedback messages right next to the input field if it has. Typically, when a user registers to a website, he needs

Re: User name validation - how to check database to find if a name has already been taken?

2009-09-25 Thread Paul Huang
Ryan Gravener-3 wrote: I think you are overcomplicating things. Validate the users input, if two users want the same name within 1 second of each request you probably have bigger problems to deal with. So you think my current solution (extending AbstractValidator) is OK? But I still