Hi,

use
  setModel(new CompoundPropertyModel(MyForm.this));
in your form constructor.

this automatically sets the submitted data to the corresponding properties

http://www.wicketstuff.org/wicket13/forminput/ has greate examples to study.


Kind regards,
Florian Sperber



mbelarbi schrieb:
I have a simple TextArea in a simple Form that looks something like this:

public class MyForm extends Form {
        TextArea message
        TextField to;
        TextField subject;
        
        public MyForm(String id) {
                super(id);

                message = new TextArea("message");
                to = new TextField("to");
                subject = new TextField("subject");
                
                add(to);
                add(subject);
                add(message);
                add(new Button("submit"));
        }
        
        protected void onSubmit() {
                System.out.println("To:" + [WHAT EVER THE 'TO' TEXTFIELD HAS] )
                System.out.println("Subject:" + [WHAT EVER THE 'SUBJECT' 
TEXTFIELD HAS] )
                System.out.println("Message:" + [WHAT EVER THE 'MESSAGE' 
TEXTAREA HAS] )
        }
}


How do I retrieve and simply print out what ever the user has inputted into
the text fields and text area on submit? It seems like a simple thing, am I
missing something?

Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to