Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8797169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:47:46+00:00 2026-06-13T23:47:46+00:00

I would really like to understand why the model object of the following code

  • 0

I would really like to understand why the model object of the following code is always null, when the same model is used by a TextField and its surrounding FormComponentPanel:

public class MyPanel extends FormComponentPanel<String> {

    private TextField<String> _field;

    public MyPanel(String id, IModel<String> model) {
        super(id, model);
        _field = new TextField<String>("field", model);
        add(_field);
    }


}

I know I can fix this by overriding the Panel’s convertInput, which is described in the Javadocs:

@Override   
protected void convertInput() {
    setConvertedInput(_field.getConvertedInput());
}

I really would like to understand why the TextField’s changes do not update the model the way I would expect: Setting the model object to the user’s input.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:47:47+00:00Added an answer on June 13, 2026 at 11:47 pm

    As “Wicket in Action” says:

    The convertInput method is called during the first phase of component validation (before any validators are executed). Implementations should parse user input and either set the converted input using setConvertedInput or report that the input couldn’t be interpreted directly. A form component panel typically doesn’t receive user input directly. But because its nested components do, and because it wants to update its own model value accordingly, we override this method.

    In your example initially the convertInput method of the text field will be called. It will update the shared model with the correct value.

    Then the convertInput method of form component panel will be called. But because form component panel doesn’t receive any input directly its getInputAsArray method will return null (if input is nullable as in your case). So the shared model will be again updated, this time with null value, and the resulting value of the model will be null in the end.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would really like some advice here, to give some background info I am
I would really like to do something like this: Callable<MyObject> myCallable = .... Future<MyObject>
I would really like to know how web sites decide what ad to show
I would really like to add an image into the Sandcastle generated help file
I would really like your help in knowing the procedure to delete a .3gp
I'm learning iOS development and would really like to look at an example application
I'm writing a perl script and I would really like to get the amount
I know this isn't a programming question but I would really like the users
Does anyone know of an equivalent to FxCop/StyleCop for Delphi? I would really like
I really would like to get a scrollbar for the page cause atm the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.