[Wicket-user] Dropdown choices in wicket
Hi, iam new to wicket, am going through the available examples, i dont understand how can i capture the selected option in a drop down choice in the wicket? I checked the example tutorial given in the ensode.net but still i dont understand how to capture the selected value of the drop down and display it after form submission Plz help one more, how to capture values from Hidden fields in wicket html page, for labels you have Label class in wicket , similarly any provision for hidden variable?? Thanks in advance Sathya -- View this message in context: http://www.nabble.com/Dropdown-choices-in-wicket-tf2124339.html#a5860810 Sent from the Wicket - User forum at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Dropdown choices in wicket
First of all, let me tell you that, I am also fairly new to Wicket. However here are my two cents. Wicket experts - Please correct me if I am wrong. How are you sending the data to the page? Are you using any model? If you are, you can retrieve the data using the model object. If not, I think you can use PageParameters to retrieve the selections from the select box just like any other component on the page. For hidden fields, I think you can use regular Textfield and set the visible (setVisible) to false. This way you have all the access to the field except that it won't be displayed on the screen. Hope this helps. -Srinu - Original Message From: sathya81 [EMAIL PROTECTED]To: wicket-user@lists.sourceforge.netSent: Friday, August 18, 2006 12:02:46 AMSubject: [Wicket-user] Dropdown choices in wicket Hi, iam new to wicket, am going through the available examples, i dontunderstandhow can i capture the selected option in a drop down choice inthe wicket? I checked the example tutorial given in theensode.net butstill i dont understand how to capture the selected value of the drop downand display it after form submissionPlz helpone more, how to capture values from Hidden fields in wicket html page, forlabels you have Label class in wicket , similarly any provision for hiddenvariable??Thanks in advanceSathya -- View this message in context: http://www.nabble.com/Dropdown-choices-in-wicket-tf2124339.html#a5860810Sent from the Wicket - User forum at Nabble.com.-Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimohttp://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Dropdown choices in wicket
About the dropdown: Use a model, maybe a property model to hold the selected dropdown object. Property models require that there are a get and setter method for the supplied property. You could also use the abstractmodel and implement your own thing, if per say you needed to update something else on the page based on what the selected dropdown are. Just to sum it up, wicket does all the nifty stuff about updating the model that you provide so you need only do your logic. Please ask if you have more questions. regards Nino -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] på vegne af sathya81 Sendt: fr 18-08-2006 09:02 Til: wicket-user@lists.sourceforge.net Cc: Emne: [Wicket-user] Dropdown choices in wicket Hi, iam new to wicket, am going through the available examples, i dont understand how can i capture the selected option in a drop down choice in the wicket? I checked the example tutorial given in the ensode.net but still i dont understand how to capture the selected value of the drop down and display it after form submission Plz help one more, how to capture values from Hidden fields in wicket html page, for labels you have Label class in wicket , similarly any provision for hidden variable?? Thanks in advance Sathya -- View this message in context: http://www.nabble.com/Dropdown-choices-in-wicket-tf2124339.html#a5860810 Sent from the Wicket - User forum at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user winmail.dat- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Dropdown choices in wicket
As well as what the others have said, take a look at the wiki, specifically http://www.wicket-wiki.org.uk/wiki/index.php/DropDownChoice_Examples, which might help. /Gwyn On 18/08/06, sathya81 [EMAIL PROTECTED] wrote: Hi, iam new to wicket, am going through the available examples, i dont understand how can i capture the selected option in a drop down choice in the wicket? I checked the example tutorial given in the ensode.net but still i dont understand how to capture the selected value of the drop down and display it after form submission Plz help one more, how to capture values from Hidden fields in wicket html page, for labels you have Label class in wicket , similarly any provision for hidden variable?? Thanks in advance Sathya -- View this message in context: http://www.nabble.com/Dropdown-choices-in-wicket-tf2124339.html#a5860810 Sent from the Wicket - User forum at Nabble.com. -- Download Wicket 1.2.1 now! - http://wicketframework.org - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Dropdown choices in wicket
Select/Combo is just as another input field. The model behind the Combobox will hold the selected value.Hidden field: See HiddenField componentBut the question is why do you need it? Normally in wicket there is no need for a hidden field to store data. johanOn 8/18/06, sathya81 [EMAIL PROTECTED] wrote: Hi, iam new to wicket, am going through the available examples, i dontunderstandhow can i capture the selected option in a drop down choice inthe wicket? I checked the example tutorial given in the ensode.net butstill i dont understand how to capture the selected value of the drop downand display it after form submissionPlz helpone more, how to capture values from Hidden fields in wicket html page, for labels you have Label class in wicket , similarly any provision for hiddenvariable??Thanks in advanceSathya--View this message in context: http://www.nabble.com/Dropdown-choices-in-wicket-tf2124339.html#a5860810Sent from the Wicket - User forum at Nabble.com.- Using Tomcat but need to do more? Need to support web services, security?Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Dropdown choices in wicket
Thanq Nino, well, iam using a model to store the data , actually i was going through the example given in the http://ensode.net/wicket_first_look.html , where in the author creates two models , the first model to store the normal form values and the second model explicitly to store the dropdown selected values , so here my doubt is if there are around 5 drop down choices in a page, then should i create 5 models for each to store the selected values? --Sathya Nino Wael wrote: About the dropdown: Use a model, maybe a property model to hold the selected dropdown object. Property models require that there are a get and setter method for the supplied property. You could also use the abstractmodel and implement your own thing, if per say you needed to update something else on the page based on what the selected dropdown are. Just to sum it up, wicket does all the nifty stuff about updating the model that you provide so you need only do your logic. Please ask if you have more questions. regards Nino -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] på vegne af sathya81 Sendt: fr 18-08-2006 09:02 Til: wicket-user@lists.sourceforge.net Cc: Emne: [Wicket-user] Dropdown choices in wicket Hi, iam new to wicket, am going through the available examples, i dont understand how can i capture the selected option in a drop down choice in the wicket? I checked the example tutorial given in the ensode.net but still i dont understand how to capture the selected value of the drop down and display it after form submission Plz help one more, how to capture values from Hidden fields in wicket html page, for labels you have Label class in wicket , similarly any provision for hidden variable?? Thanks in advance Sathya -- View this message in context: http://www.nabble.com/Dropdown-choices-in-wicket-tf2124339.html#a5860810 Sent from the Wicket - User forum at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/Dropdown-choices-in-wicket-tf2124339.html#a5866196 Sent from the Wicket - User forum at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Dropdown choices in wicket
Hi Sathya Yes you should use one model for each of your dropdowns. Lets say you are creating a site where you can search for books. Then you might have a drop down for author and maybe category. I guess(without knowing anything about searching and or books:)) that I would create a class that holds the search criteria eg: search.java private author private category getter setter methods goes here so on my wicket page i'll have the following pseudo code: private Search bookSearch=new Search; Imodel author=new Propertymodel(bookSearch.author,search); Imodel category=new Propertymodel(BookSearchcategory,search); dropdown dropAuthor=new dropdown(id, author); add(drop) dropdown dropCat=new dropdown(id,category); add(drop) button search=new Button(id){onsubmit( process(search)) } add(search) I hope my simple example contributes to something usefull:) Regards Nino -Original Message- From: [EMAIL PROTECTED] on behalf of sathya81 Sent: Fri 18-08-2006 11:00 To: wicket-user@lists.sourceforge.net Cc: Subject:Re: [Wicket-user] Dropdown choices in wicket Thanq Nino, well, iam using a model to store the data , actually i was going through the example given in the http://ensode.net/wicket_first_look.html , where in the author creates two models , the first model to store the normal form values and the second model explicitly to store the dropdown selected values , so here my doubt is if there are around 5 drop down choices in a page, then should i create 5 models for each to store the selected values? --Sathya Nino Wael wrote: About the dropdown: Use a model, maybe a property model to hold the selected dropdown object. Property models require that there are a get and setter method for the supplied property. You could also use the abstractmodel and implement your own thing, if per say you needed to update something else on the page based on what the selected dropdown are. Just to sum it up, wicket does all the nifty stuff about updating the model that you provide so you need only do your logic. Please ask if you have more questions. regards Nino -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] på vegne af sathya81 Sendt: fr 18-08-2006 09:02 Til: wicket-user@lists.sourceforge.net Cc: Emne: [Wicket-user] Dropdown choices in wicket Hi, iam new to wicket, am going through the available examples, i dont understand how can i capture the selected option in a drop down choice in the wicket? I checked the example tutorial given in the ensode.net but still i dont understand how to capture the selected value of the drop down and display it after form submission Plz help one more, how to capture values from Hidden fields in wicket html page, for labels you have Label class in wicket , similarly any provision for hidden variable?? Thanks in advance Sathya -- View this message in context: http://www.nabble.com/Dropdown-choices-in-wicket-tf2124339.html#a5860810 Sent from the Wicket - User forum at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/Dropdown-choices-in-wicket-tf2124339.html#a5866196 Sent from the Wicket - User forum at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user
Re: [Wicket-user] Dropdown choices in wicket
Hmm - should isn't really correct - could, yes, but not should. Personally, I'd suggest a single CompondPropertyModel, set for the form, if not the page, as that can really cut down on the code you need to write. That also solves where to put any associated data, as the ModelObject that the CPM wraps isn't restricted to /just/ the form data. No need for 'hidden' client-side properties! /Gwyn On 18/08/06, Nino Wael [EMAIL PROTECTED] wrote: Hi Sathya Yes you should use one model for each of your dropdowns. Lets say you are creating a site where you can search for books. Then you might have a drop down for author and maybe category. I guess(without knowing anything about searching and or books:)) that I would create a class that holds the search criteria eg: search.java private author private category getter setter methods goes here so on my wicket page i'll have the following pseudo code: private Search bookSearch=new Search; Imodel author=new Propertymodel(bookSearch.author,search); Imodel category=new Propertymodel(BookSearchcategory,search); dropdown dropAuthor=new dropdown(id, author); add(drop) dropdown dropCat=new dropdown(id,category); add(drop) button search=new Button(id){onsubmit( process(search)) } add(search) I hope my simple example contributes to something usefull:) Regards Nino -Original Message- From: [EMAIL PROTECTED] on behalf of sathya81 Sent: Fri 18-08-2006 11:00 To: wicket-user@lists.sourceforge.net Cc: Subject:Re: [Wicket-user] Dropdown choices in wicket Thanq Nino, well, iam using a model to store the data , actually i was going through the example given in the http://ensode.net/wicket_first_look.html , where in the author creates two models , the first model to store the normal form values and the second model explicitly to store the dropdown selected values , so here my doubt is if there are around 5 drop down choices in a page, then should i create 5 models for each to store the selected values? --Sathya Nino Wael wrote: About the dropdown: Use a model, maybe a property model to hold the selected dropdown object. Property models require that there are a get and setter method for the supplied property. You could also use the abstractmodel and implement your own thing, if per say you needed to update something else on the page based on what the selected dropdown are. Just to sum it up, wicket does all the nifty stuff about updating the model that you provide so you need only do your logic. Please ask if you have more questions. regards Nino -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] på vegne af sathya81 Sendt: fr 18-08-2006 09:02 Til: wicket-user@lists.sourceforge.net Cc: Emne: [Wicket-user] Dropdown choices in wicket Hi, iam new to wicket, am going through the available examples, i dont understand how can i capture the selected option in a drop down choice in the wicket? I checked the example tutorial given in the ensode.net but still i dont understand how to capture the selected value of the drop down and display it after form submission Plz help one more, how to capture values from Hidden fields in wicket html page, for labels you have Label class in wicket , similarly any provision for hidden variable?? Thanks in advance Sathya -- View this message in context: http://www.nabble.com/Dropdown-choices-in-wicket-tf2124339.html#a5860810 Sent from the Wicket - User forum at Nabble.com. -- Download Wicket 1.2.1 now! - http://wicketframework.org - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Dropdown choices in wicket
true, I was meerly trying to explain that you really dont have to grab the selected object, as this is what wicket does for you:) I havent yet worked with compoundProperty models... -regards Nino -Original Message- From: [EMAIL PROTECTED] on behalf of Gwyn Evans Sent: Fri 18-08-2006 13:46 To: wicket-user@lists.sourceforge.net Cc: Subject:Re: [Wicket-user] Dropdown choices in wicket Hmm - should isn't really correct - could, yes, but not should. Personally, I'd suggest a single CompondPropertyModel, set for the form, if not the page, as that can really cut down on the code you need to write. That also solves where to put any associated data, as the ModelObject that the CPM wraps isn't restricted to /just/ the form data. No need for 'hidden' client-side properties! /Gwyn On 18/08/06, Nino Wael [EMAIL PROTECTED] wrote: Hi Sathya Yes you should use one model for each of your dropdowns. Lets say you are creating a site where you can search for books. Then you might have a drop down for author and maybe category. I guess(without knowing anything about searching and or books:)) that I would create a class that holds the search criteria eg: search.java private author private category getter setter methods goes here so on my wicket page i'll have the following pseudo code: private Search bookSearch=new Search; Imodel author=new Propertymodel(bookSearch.author,search); Imodel category=new Propertymodel(BookSearchcategory,search); dropdown dropAuthor=new dropdown(id, author); add(drop) dropdown dropCat=new dropdown(id,category); add(drop) button search=new Button(id){onsubmit( process(search)) } add(search) I hope my simple example contributes to something usefull:) Regards Nino -Original Message- From: [EMAIL PROTECTED] on behalf of sathya81 Sent: Fri 18-08-2006 11:00 To: wicket-user@lists.sourceforge.net Cc: Subject:Re: [Wicket-user] Dropdown choices in wicket Thanq Nino, well, iam using a model to store the data , actually i was going through the example given in the http://ensode.net/wicket_first_look.html , where in the author creates two models , the first model to store the normal form values and the second model explicitly to store the dropdown selected values , so here my doubt is if there are around 5 drop down choices in a page, then should i create 5 models for each to store the selected values? --Sathya Nino Wael wrote: About the dropdown: Use a model, maybe a property model to hold the selected dropdown object. Property models require that there are a get and setter method for the supplied property. You could also use the abstractmodel and implement your own thing, if per say you needed to update something else on the page based on what the selected dropdown are. Just to sum it up, wicket does all the nifty stuff about updating the model that you provide so you need only do your logic. Please ask if you have more questions. regards Nino -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] på vegne af sathya81 Sendt: fr 18-08-2006 09:02 Til: wicket-user@lists.sourceforge.net Cc: Emne: [Wicket-user] Dropdown choices in wicket Hi, iam new to wicket, am going through the available examples, i dont understand how can i capture the selected option in a drop down choice in the wicket? I checked the example tutorial given in the ensode.net but still i dont understand how to capture the selected value of the drop down and display it after form submission Plz help one more, how to capture values from Hidden fields in wicket html page, for labels you have Label class in wicket , similarly any provision for hidden variable?? Thanks in advance Sathya -- View this message in context: http://www.nabble.com/Dropdown-choices-in-wicket-tf2124339.html#a5860810 Sent from the Wicket - User forum at Nabble.com. -- Download Wicket 1.2.1 now! - http://wicketframework.org - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user winmail.dat- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application