You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by xiaowang <jy...@gmail.com> on 2012/03/13 18:22:11 UTC

How to submit a result of dropdownchoice and a result of input text simultaneously?

How to submit a result of dropdownchoice and a result of input text
simultaneously?
http://apache-wicket.1842946.n4.nabble.com/file/n4469660/1.jpg 

Can anyone give me an example? Thank you very much!

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-submit-a-result-of-dropdownchoice-and-a-result-of-input-text-simultaneously-tp4469660p4469660.html
Sent from the Users forum 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: How to submit a result of dropdownchoice and a result of input text simultaneously?

Posted by xiaowang <jy...@gmail.com>.
Thanks very much for your help. I have finished it.
I know it is a very simple question. But if any other new people have the
same question, just email me. 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-submit-a-result-of-dropdownchoice-and-a-result-of-input-text-simultaneously-tp4469660p4473193.html
Sent from the Users forum 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: How to submit a result of dropdownchoice and a result of input text simultaneously?

Posted by Dan Retzlaff <dr...@gmail.com>.
You need to give form components like DropDownChoice and TextField an
IModel into which the submitted value will be placed. You did this with a
PropertyModel for your DropDownChoice. You need to do similar for the
TextField.

Good luck, I hope you enjoy Wicket!

On Tue, Mar 13, 2012 at 10:26 AM, xiaowang <jy...@gmail.com> wrote:

> I am totally new in wicket, can anyone help me?
> Now my code is:
>
>  //dropdownbox
>                add(new FeedbackPanel("dropdownfeedback"));
>                DropDownChoice<String> listSites = new
> DropDownChoice<String>(
>                                "sites", new PropertyModel<String>(this,
> "selected"),
> SEARCH_ENGINES);
>
>
>                Form<?> dropdownform = new Form<Void>("dropdownform") {
>                                @Override
>                                protected void onSubmit() {
>
>                                        info("You select : " + selected);
>
>                                }
>                        };
>
>                //add name text
>                TextField<String> Name = new TextField<String>("Name");
>                Name.setRequired(true);
>                dropdownform.add(Name);
>                ComponentFeedbackPanel fbName = new
> ComponentFeedbackPanel("fbName", Name);
>                dropdownform.add(fbName);
>                //add Age text
>                TextField<String> Age = new TextField<String>("Age");
>                Age.setRequired(true);
>                dropdownform.add(Age);
>                ComponentFeedbackPanel fbAge = new
> ComponentFeedbackPanel("fbAge",
> Age);
>                dropdownform.add(fbAge);
>
>                        add(dropdownform);
>                        dropdownform.add(listSites);
>
> It get a "Attempt to set model object on null model of component:
> dropdownform:Name"
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-submit-a-result-of-dropdownchoice-and-a-result-of-input-text-simultaneously-tp4469660p4469677.html
> Sent from the Users forum 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: How to submit a result of dropdownchoice and a result of input text simultaneously?

Posted by xiaowang <jy...@gmail.com>.
I am totally new in wicket, can anyone help me?
Now my code is:

 //dropdownbox
	        add(new FeedbackPanel("dropdownfeedback"));
	        DropDownChoice<String> listSites = new DropDownChoice<String>(
	    			"sites", new PropertyModel<String>(this, "selected"),
SEARCH_ENGINES);
	        
	        
	        Form<?> dropdownform = new Form<Void>("dropdownform") {
				@Override
				protected void onSubmit() {
			        
					info("You select : " + selected);
	 
				}
			};	 
			
	        //add name text
	        TextField<String> Name = new TextField<String>("Name");
	        Name.setRequired(true);
	        dropdownform.add(Name);
	        ComponentFeedbackPanel fbName = new
ComponentFeedbackPanel("fbName", Name);
	        dropdownform.add(fbName); 
	        //add Age text
	        TextField<String> Age = new TextField<String>("Age");
	        Age.setRequired(true);
	        dropdownform.add(Age);
	        ComponentFeedbackPanel fbAge = new ComponentFeedbackPanel("fbAge",
Age);
	        dropdownform.add(fbAge); 
			
			add(dropdownform);
			dropdownform.add(listSites);

It get a "Attempt to set model object on null model of component:
dropdownform:Name"

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-submit-a-result-of-dropdownchoice-and-a-result-of-input-text-simultaneously-tp4469660p4469677.html
Sent from the Users forum 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