I'm trying to figure out what happens to my model object between the constructor of my Form and when its onSubmit() method is called. It took me some time to realize that it was in what I think of the never-land between these two points in my code that one of my model's properties becomes null. I tried overriding onRender() and it was still intact there, but during onSubmit() it was null.

Is there someplace else my code has the ability to adjust this value? Or is there some good place to set a breakpoint to chase this down?

  -- Scott



    private static class InputForm extends Form {
        public InputForm(String name, Guideline guideline) {
            super(name, new CompoundPropertyModel(guideline));
            // [ ... ]
            add(new TextField("description"));
            // [ ... ]
            System.out.println("Constructor - description: " +
                               guideline.getDescription());
        }
        // outputs "Test Guideline"

        protected void onRender() {
            super.onRender();
            Guideline guideline = (Guideline) getModelObject();
            System.out.println("onRender() - description: " +
                               guideline.getDescription());
        }
        // outputs "Test Guideline"

        public void onSubmit() {
            Guideline guideline = (Guideline) getModelObject();
            System.out.println("onSubmit() - description: " +
                               guideline.getDescription());
            // [ ... ]
        }
        // outputs null
    }




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to