You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by raybristol <ra...@gmail.com> on 2007/09/24 17:58:43 UTC

newbie question about using WizardStep, help! thanks!

Hi experts,

I want to implement a wizard, user need to input some data, I can do it with
a single page using form, but I don't know how to do it in wizard, I put a
couple of input textfield etc. then I get a error:

java.lang.IllegalStateException: Attempt to set model object on null model
of component: wizard:form:view:expectedNumberOfBoxes

Note: expectedNumberOfBoxes is the first textfield I declared in the java
class, after googling a few hours(not too much information) I think I need
to setup a 'model'? but I probably need more details how... my code is like:

public class DeliveryDetails extends WizardStep {


	public DeliveryDetails(Delivery delivery, String title, String content){
		super(title, content);
		
		RequiredTextField expectedNumberOfBoxesTextField = new
RequiredTextField("expectedNumberOfBoxes", Integer.class);
		add(expectedNumberOfBoxesTextField);
		
		RequiredTextField receivedNumberOfBoxesTextField = new
RequiredTextField("receivedNumberOfBoxes", Integer.class);
		add(receivedNumberOfBoxesTextField);

	}


Thansk a million for your help as this really difficult to solve by
googling! thanks!

	
}
-- 
View this message in context: http://www.nabble.com/newbie-question-about-using-WizardStep%2C-help%21-thanks%21-tf4509850.html#a12862126
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: newbie question about using WizardStep, help! thanks!

Posted by raybristol <ra...@gmail.com>.
Great! that's what I want, thanks so much and sorry for my stupid questions
:)



Eelco Hillenius wrote:
> 
>> Hi experts,
>>
>> I want to implement a wizard, user need to input some data, I can do it
>> with
>> a single page using form, but I don't know how to do it in wizard, I put
>> a
>> couple of input textfield etc. then I get a error:
>>
>> java.lang.IllegalStateException: Attempt to set model object on null
>> model
>> of component: wizard:form:view:expectedNumberOfBoxes
>>
>> Note: expectedNumberOfBoxes is the first textfield I declared in the java
>> class, after googling a few hours(not too much information) I think I
>> need
>> to setup a 'model'? but I probably need more details how... my code is
>> like:
>>
>> public class DeliveryDetails extends WizardStep {
>>
>>
>>         public DeliveryDetails(Delivery delivery, String title, String
>> content){
>>                 super(title, content);
>>
>>                 RequiredTextField expectedNumberOfBoxesTextField = new
>> RequiredTextField("expectedNumberOfBoxes", Integer.class);
>>                 add(expectedNumberOfBoxesTextField);
>>
>>                 RequiredTextField receivedNumberOfBoxesTextField = new
>> RequiredTextField("receivedNumberOfBoxes", Integer.class);
>>                 add(receivedNumberOfBoxesTextField);
>>
>>         }
> 
> Yep, you need to work with models. For instance:
> 
> RequiredTextField receivedNumberOfBoxesTextField = new
> RequiredTextField("receivedNumberOfBoxes", Integer.class, new
> PropertyModel(delivery, "receivedNumberOfBoxes"));
> add(receivedNumberOfBoxesTextField);
> 
> or:
> 
> setModel(new CompoundPropertyModel(delivery));
> RequiredTextField receivedNumberOfBoxesTextField = new
> RequiredTextField("receivedNumberOfBoxes", Integer.class);
> add(receivedNumberOfBoxesTextField);
> 
> 
> Eelco
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/newbie-question-about-using-WizardStep%2C-help%21-thanks%21-tf4509850.html#a12878125
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: newbie question about using WizardStep, help! thanks!

Posted by Eelco Hillenius <ee...@gmail.com>.
> Hi experts,
>
> I want to implement a wizard, user need to input some data, I can do it with
> a single page using form, but I don't know how to do it in wizard, I put a
> couple of input textfield etc. then I get a error:
>
> java.lang.IllegalStateException: Attempt to set model object on null model
> of component: wizard:form:view:expectedNumberOfBoxes
>
> Note: expectedNumberOfBoxes is the first textfield I declared in the java
> class, after googling a few hours(not too much information) I think I need
> to setup a 'model'? but I probably need more details how... my code is like:
>
> public class DeliveryDetails extends WizardStep {
>
>
>         public DeliveryDetails(Delivery delivery, String title, String content){
>                 super(title, content);
>
>                 RequiredTextField expectedNumberOfBoxesTextField = new
> RequiredTextField("expectedNumberOfBoxes", Integer.class);
>                 add(expectedNumberOfBoxesTextField);
>
>                 RequiredTextField receivedNumberOfBoxesTextField = new
> RequiredTextField("receivedNumberOfBoxes", Integer.class);
>                 add(receivedNumberOfBoxesTextField);
>
>         }

Yep, you need to work with models. For instance:

RequiredTextField receivedNumberOfBoxesTextField = new
RequiredTextField("receivedNumberOfBoxes", Integer.class, new
PropertyModel(delivery, "receivedNumberOfBoxes"));
add(receivedNumberOfBoxesTextField);

or:

setModel(new CompoundPropertyModel(delivery));
RequiredTextField receivedNumberOfBoxesTextField = new
RequiredTextField("receivedNumberOfBoxes", Integer.class);
add(receivedNumberOfBoxesTextField);


Eelco

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