Re: Attempt to set model object on null model of component

2009-09-29 Thread Pedro Santos
You need to find if the component who throw the exception is the same agent
constructed with lines you report and on what moment the component lost his
model.


On Mon, Sep 28, 2009 at 11:28 PM, Sam Barrow s...@sambarrow.com wrote:

 I'm getting this exception:
 java.lang.IllegalStateException: Attempt to set model object on null
 model of component: form:agent

 The only reason i can find is that the field has a null model, but i added
 a new Model() to the field and im still getting it

 DropDownChoiceAgent agent = new DropDownChoiceAgent(agent, new
 ModelAgent(), agentList);


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Pedro Henrique Oliveira dos Santos


Re: Attempt to set model object on null model of component when submitting a form

2008-09-16 Thread Azzeddine Daddah
Thanks Stefan :)

On Tue, Sep 16, 2008 at 3:04 PM, Stefan Lindner [EMAIL PROTECTED] wrote:

 Your DropDownChoice element has no Model so the submit code does not know
 where to store your selection. Add a

 new ModelString()

 to it's constructor.

 -Ursprüngliche Nachricht-
 Von: Azzeddine Daddah [mailto:[EMAIL PROTECTED]
 Gesendet: Dienstag, 16. September 2008 15:01
 An: users@wicket.apache.org
 Betreff: Attempt to set model object on null model of component when
 submitting a form

 Hi,

 I've the following code:

 private static final ListString SEARCH_DOMAINS = Arrays.asList(AA,
 BB);
 ...
 private void addSearchForm() {
Form searchForm = new Form(searchForm);
searchForm.add(new DropDownChoice(searchDomain, SEARCH_DOMAINS));
searchForm.add(new TextField(areaCode, new Model(),
 Integer.class));

Button submiButton = new Button(submiButton) {
private static final long serialVersionUID = 1L;

public void onSubmit() {
info(submiButton executed);
}
};

searchForm.add(submiButton);
add(searchForm);
}

 When I hit the submit button I get this error: Attempt to set model object
 on null model of component.

 Could you please tell me what am I doing wrong?

 Gr. Azzeddine

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




-- 
Azzeddine Daddah
www.hbiloo.com