Mahdi Karami
Mahdi Karami

Reputation: 94

Get value of a input in wicket

I'm not familiar with wicket.

I want to get value of input in html page and convert it to a string and work on it in java mode, but I don't know how to do it.

Any help would be appreciated.

Upvotes: 0

Views: 3171

Answers (2)

ANGRY PENGUIN
ANGRY PENGUIN

Reputation: 85

For example:

    PasswordTextField ptf = new PasswordTextField("password", Model.of(""));

    Form form = new Form("exampleForm"){
                @Override
                public void onSubmit() {
                   System.out.print(ptf.getModelObject());
                }
    }
    form.add(ptf);

So When u submit the form - you get get submitted value from Password Text Field by calling getModelObject() method on textField object.

Upvotes: 1

Related Questions