if you assigned to that null field (clearly not with the code below) and you are still getting an NPE, it could not be the /same/ error by definition. i suggest you slow down, get out a debugger and think this through.
kengimel wrote: > > i assigned new Model() to the field. > > String sym = (String) new Model().getObject(); > int stockValue = sym.hashCode() % 100; > QuoteResult quoteResult = new QuoteResult(stockValue); > setResponsePage(quoteResult); > > and it still threw the same error. > > i also found some additional inform from clicking the display page view. > > > Page > > [Page class = myapp.stockquote.GetQuoteSymbol, id = 0, version = 0]: > # Path Size Type Model Object > 1 f 1.6K org.apache.wicket.markup.html.form.Form > > 2 f:sym 813 bytes > org.apache.wicket.markup.html.form.TextField MSFT > > Jonathan Locke wrote: >> >> >> no, the problem is more basic than that. it would work if new Model() was >> assigned to the field. instead it is being assigned to a local variable, >> which goes out of scope, leaving the field still null: >> >> Model model = new Model("MSFT"); >> >> if the field were final, the compiler would warn that the field was never >> assigned. >> >> >> Newgro wrote: >>> >>> Hello Kengimel, >>> >>> You do this >>> private Model model; >>> and that >>> String sym = (String) model.getObject(); >>> >>> but you did not >>> form.setModel(model) >>> or @ least >>> setModel(model) >>> >>> You only can get things you've assigned before. >>> >>> Cheers >>> Per >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/Problem-with-Textfield-tp17170575p17179519.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]