You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by maven apache <ap...@gmail.com> on 2009/12/06 09:40:27 UTC

basic problem of using wicket

Hi:
I have reffered the wicket wiki and the faq but some problem still exist.So
I ask for help.
1) the page jump.
For example in a user login page, after the submit button are clicked I want
user jump to success page or error page.
So how to ?
In my login page:
public class LoginPage extends WebPage{
  ...........
  add(new LoginForm("loginForm"))
}

public class LoginForm .........{
TextField nameText=new TextField("name");
TextField passText=new TextField("pass");  //how to make a password
textfield to hind the char user entering?
                public void onSubmit() {
                   /// here how to add listener to the submitButton to jump?
                }
//   Button submitButton=new Button("submit");   ///// do I need to specify
a submit button?(make the wicket know that "this is a submit button,when
clicked,you should do something?)
add(nameText);
add(ageText);
}


2) when to use wicket tag
That to say if I want to show some message, I can write it in the html or
create a label in java source.
Take the above page for example, the textfield can be also defined in the
html element like:
<input type="password" value="" />, and the submit button can be <input
type="submit" ,,,,/>
What I mean is when to use the wicket and when to use the html element ?

Re: basic problem of using wicket

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
It looks like you need help with the very basics, have a look at Pro
Wicket at Google Books it has all necessary examples fo what you are
doing:

http://books.google.com/books?id=bA8yTZIZQCsC&dq=pro+wicket&printsec=frontcover&source=bl&ots=mmwyOdfFs8&sig=v2m3vxDLQVlesze9iBnnJCacuQA&hl=fi&ei=A28bS9S6LszP-Qaa4ZjJDw&sa=X&oi=book_result&ct=result&resnum=4&ved=0CBsQ6AEwAw#v=onepage&q=&f=false

**
Martin

2009/12/6 maven apache <ap...@gmail.com>:
> Hi:
> I have reffered the wicket wiki and the faq but some problem still exist.So
> I ask for help.
> 1) the page jump.
> For example in a user login page, after the submit button are clicked I want
> user jump to success page or error page.
> So how to ?
> In my login page:
> public class LoginPage extends WebPage{
>  ...........
>  add(new LoginForm("loginForm"))
> }
>
> public class LoginForm .........{
> TextField nameText=new TextField("name");
> TextField passText=new TextField("pass");  //how to make a password
> textfield to hind the char user entering?
>                public void onSubmit() {
>                   /// here how to add listener to the submitButton to jump?
>                }
> //   Button submitButton=new Button("submit");   ///// do I need to specify
> a submit button?(make the wicket know that "this is a submit button,when
> clicked,you should do something?)
> add(nameText);
> add(ageText);
> }
>
>
> 2) when to use wicket tag
> That to say if I want to show some message, I can write it in the html or
> create a label in java source.
> Take the above page for example, the textfield can be also defined in the
> html element like:
> <input type="password" value="" />, and the submit button can be <input
> type="submit" ,,,,/>
> What I mean is when to use the wicket and when to use the html element ?
>

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


Re: basic problem of using wicket

Posted by Andrew Lombardi <an...@mysticcoders.com>.
On Dec 6, 2009, at 12:40 AM, maven apache wrote:

> For example in a user login page, after the submit button are clicked I want
> user jump to success page or error page.
> So how to ?

setResponsePage(MyNewPage.class)

> In my login page:
> public class LoginPage extends WebPage{
>  ...........
>  add(new LoginForm("loginForm"))
> }
> 
> public class LoginForm .........{
> TextField nameText=new TextField("name");
> TextField passText=new TextField("pass");  //how to make a password
> textfield to hind the char user entering?
>                public void onSubmit() {
>                   /// here how to add listener to the submitButton to jump?
>                }
> //   Button submitButton=new Button("submit");   ///// do I need to specify
> a submit button?(make the wicket know that "this is a submit button,when
> clicked,you should do something?)

if there's only one submit button, specifying a button isn't necessarily required.

> add(nameText);
> add(ageText);
> }
> 
> 
> 2) when to use wicket tag
> That to say if I want to show some message, I can write it in the html or
> create a label in java source.
> Take the above page for example, the textfield can be also defined in the
> html element like:
> <input type="password" value="" />, and the submit button can be <input
> type="submit" ,,,,/>
> What I mean is when to use the wicket and when to use the html element ?

when it's appropriate.  wicket:id tags are for mapping to components where you'd like to pull or push data to.  it's not an either/or situation.



To our success!

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

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

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