Re: Ajax callback for checkbox component?
The ZoneUpdater mixin also works for checkboxes: t:radiogroup t:id=costType t:validate=required t:radio t:id=regularCostType t:mixins=cb/zoneUpdater t:zone=addzone t:clientEvent=click event=change / ... mrg On Mon, Jul 4, 2011 at 8:11 AM, Dmitriy Vsekhvalnov dvsekhval...@gmail.com wrote: For checkbox or for select component? :) I'm using ZoneUpdater mixin for selects, all my selects looks like: select t:id=area t:type=select value=area t:blankLabel=select area t:clientEvent=change t:event=areaChanged t:mixins=zoneUpdater t:model=areasModel t:zoneupdater.zone=contentZone / and server code is: public Object onAreaChanged() { .. } On Mon, Jul 4, 2011 at 1:35 PM, Joel Halbert j...@su3analytics.com wrote: OK np. Thanks Thiago! On Sun, 2011-07-03 at 19:53 -0300, Thiago H. de Paula Figueiredo wrote: On Sun, 03 Jul 2011 14:54:22 -0300, Joel Halbert j...@su3analytics.com wrote: Hi Folks, Hi! Is there an equivalent callback for a checkbox? Not out-of-the-box, but you can use a little bit of custom JavaScript plus a custom event (URL created by ComponentResources.createEventLink()) for that. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Ajax callback for checkbox component?
Is the ZoneUpdater mixin hosted anywhere? I grabbed the latest copy from http://tinybits.blogspot.com/2011/03/zoneupdater-jquery-edition.html because I'm using tapestry5-jquery and made two small improvements (IMHO) to it. 1 - The ability to add the mixin to a button .. that when clicked submits the value of a specified field 2 - The ability to clear the value of the input after a successful AJAX call. (Not sure what it would do for a checkbox/radiobutton) Anyways, I wanted to contribute my changes back, but I couldn't find any contact info @tinybits. I was going to contribute it to tapestry5-jquery but the original has no licensing info. Are my changes useful to anyone? What can I do to contribute them back in a useful way? Thanks - Tony On Jul 11, 2011, at 6:34 AM, Michael Gentry wrote: The ZoneUpdater mixin also works for checkboxes: t:radiogroup t:id=costType t:validate=required t:radio t:id=regularCostType t:mixins=cb/zoneUpdater t:zone=addzone t:clientEvent=click event=change / ... mrg On Mon, Jul 4, 2011 at 8:11 AM, Dmitriy Vsekhvalnov dvsekhval...@gmail.com wrote: For checkbox or for select component? :) I'm using ZoneUpdater mixin for selects, all my selects looks like: select t:id=area t:type=select value=area t:blankLabel=select area t:clientEvent=change t:event=areaChanged t:mixins=zoneUpdater t:model=areasModel t:zoneupdater.zone=contentZone / and server code is: public Object onAreaChanged() { .. } On Mon, Jul 4, 2011 at 1:35 PM, Joel Halbert j...@su3analytics.com wrote: OK np. Thanks Thiago! On Sun, 2011-07-03 at 19:53 -0300, Thiago H. de Paula Figueiredo wrote: On Sun, 03 Jul 2011 14:54:22 -0300, Joel Halbert j...@su3analytics.com wrote: Hi Folks, Hi! Is there an equivalent callback for a checkbox? Not out-of-the-box, but you can use a little bit of custom JavaScript plus a custom event (URL created by ComponentResources.createEventLink()) for that. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Ajax callback for checkbox component?
OK np. Thanks Thiago! On Sun, 2011-07-03 at 19:53 -0300, Thiago H. de Paula Figueiredo wrote: On Sun, 03 Jul 2011 14:54:22 -0300, Joel Halbert j...@su3analytics.com wrote: Hi Folks, Hi! Is there an equivalent callback for a checkbox? Not out-of-the-box, but you can use a little bit of custom JavaScript plus a custom event (URL created by ComponentResources.createEventLink()) for that. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Ajax callback for checkbox component?
For checkbox or for select component? :) I'm using ZoneUpdater mixin for selects, all my selects looks like: select t:id=area t:type=select value=area t:blankLabel=select area t:clientEvent=change t:event=areaChanged t:mixins=zoneUpdater t:model=areasModel t:zoneupdater.zone=contentZone / and server code is: public Object onAreaChanged() { .. } On Mon, Jul 4, 2011 at 1:35 PM, Joel Halbert j...@su3analytics.com wrote: OK np. Thanks Thiago! On Sun, 2011-07-03 at 19:53 -0300, Thiago H. de Paula Figueiredo wrote: On Sun, 03 Jul 2011 14:54:22 -0300, Joel Halbert j...@su3analytics.com wrote: Hi Folks, Hi! Is there an equivalent callback for a checkbox? Not out-of-the-box, but you can use a little bit of custom JavaScript plus a custom event (URL created by ComponentResources.createEventLink()) for that. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Ajax callback for checkbox component?
Hi Folks, You can register for an ajax callback from select components like so: page.tml: t:select t:id=name value=name model=nameModel blankOption=NEVER t:zone=buttonZone / Page.java: Object onValueChangedFromName(String name) { // update zone } Is there an equivalent callback for a checkbox? Thanks! Joel
Re: Ajax callback for checkbox component?
On Sun, 03 Jul 2011 14:54:22 -0300, Joel Halbert j...@su3analytics.com wrote: Hi Folks, Hi! Is there an equivalent callback for a checkbox? Not out-of-the-box, but you can use a little bit of custom JavaScript plus a custom event (URL created by ComponentResources.createEventLink()) for that. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5 checkbox component and validation
Does the checkbox component provided with tapestry support validation? (via the @Validate annotation?) I¹m trying it and it doesn¹t seem to validate on either the client side or the server side My example code: ValidateCheckbox.tml html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; body t:formt:label for=tickMeTick Me/t:label t:checkbox t:id=tickMe t:value=tickMe/t:checkboxt:submit / /t:form /body /html ValidateCheckbox.java public class ValidateCheckbox {@Property@Validate(required) private Boolean tickMe;} Thanks in advance for any help/tips! Ciaran Wood
RE: T5 checkbox component and validation
the @Validate is only interpreted if used in a bean that is displayed by a BeanEditor(Form). in your case you'd have to apply directly to your checkbox ...t:checkbox t:validate=required g, kris Ciaran Wood [EMAIL PROTECTED] 11.06.2008 16:38 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5 checkbox component and validation Does the checkbox component provided with tapestry support validation? (via the @Validate annotation?) I¹m trying it and it doesn¹t seem to validate on either the client side or the server side My example code: ValidateCheckbox.tml html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; body t:formt:label for=tickMeTick Me /t:label t:checkbox t:id=tickMe t:value=tickMe/t:checkboxt:submit / /t:form /body /html ValidateCheckbox.java public class ValidateCheckbox {@Property@Validate(required) private Boolean tickMe;} Thanks in advance for any help/tips! Ciaran Wood
Re: T5 checkbox component and validation
I just tried that, no luck! It still doesn't do any validation. If it helps I'm using the 5.0.13-SNAPSHOT release. Ciaran Wood On 11/06/2008 3:46pm, Kristian Marinkovic [EMAIL PROTECTED] wrote: the @Validate is only interpreted if used in a bean that is displayed by a BeanEditor(Form). in your case you'd have to apply directly to your checkbox ...t:checkbox t:validate=required g, kris Ciaran Wood [EMAIL PROTECTED] 11.06.2008 16:38 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5 checkbox component and validation Does the checkbox component provided with tapestry support validation? (via the @Validate annotation?) I¹m trying it and it doesn¹t seem to validate on either the client side or the server side My example code: ValidateCheckbox.tml html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; body t:formt:label for=tickMeTick Me /t:label t:checkbox t:id=tickMe t:value=tickMe/t:checkboxt:submit / /t:form /body /html ValidateCheckbox.java public class ValidateCheckbox {@Property@Validate(required) private Boolean tickMe;} Thanks in advance for any help/tips! Ciaran Wood - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Antwort: Re: T5 checkbox component and validation
oops... you're right there is no validate parameter defined for a checkbox. :) you could use the onValidateFormFromFormComponentId event instead g, kris Ciaran Wood [EMAIL PROTECTED] 11.06.2008 16:51 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: T5 checkbox component and validation I just tried that, no luck! It still doesn't do any validation. If it helps I'm using the 5.0.13-SNAPSHOT release. Ciaran Wood On 11/06/2008 3:46pm, Kristian Marinkovic [EMAIL PROTECTED] wrote: the @Validate is only interpreted if used in a bean that is displayed by a BeanEditor(Form). in your case you'd have to apply directly to your checkbox ...t:checkbox t:validate=required g, kris Ciaran Wood [EMAIL PROTECTED] 11.06.2008 16:38 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5 checkbox component and validation Does the checkbox component provided with tapestry support validation? (via the @Validate annotation?) I¹m trying it and it doesn¹t seem to validate on either the client side or the server side My example code: ValidateCheckbox.tml html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; body t:formt:label for=tickMeTick Me /t:label t:checkbox t:id=tickMe t:value=tickMe/t:checkbox t:submit / /t:form /body /html ValidateCheckbox.java public class ValidateCheckbox {@Property @Validate(required) private Boolean tickMe;} Thanks in advance for any help/tips! Ciaran Wood - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Antwort: Re: T5 checkbox component and validation
Hi Guys, validate=required on a checkbox does not make sense to me. A chekbox can either be unchecked (resulting in false) or checked (resulting in true). I.e. the validation required can never fail. Could it be you are talking about t:radio and t:radiogroup ? Regards nillehammer - original Nachricht Betreff: Antwort: Re: T5 checkbox component and validation Gesendet: Mi, 11. Jun 2008 Von: Kristian Marinkovic[EMAIL PROTECTED] oops... you're right there is no validate parameter defined for a checkbox. :) you could use the onValidateFormFromFormComponentId event instead g, kris Ciaran Wood [EMAIL PROTECTED] 11.06.2008 16:51 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: T5 checkbox component and validation I just tried that, no luck! It still doesn't do any validation. If it helps I'm using the 5.0.13-SNAPSHOT release. Ciaran Wood On 11/06/2008 3:46pm, Kristian Marinkovic [EMAIL PROTECTED] wrote: the @Validate is only interpreted if used in a bean that is displayed by a BeanEditor(Form). in your case you'd have to apply directly to your checkbox ...t:checkbox t:validate=required g, kris Ciaran Wood [EMAIL PROTECTED] 11.06.2008 16:38 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5 checkbox component and validation Does the checkbox component provided with tapestry support validation? (via the @Validate annotation?) I¹m trying it and it doesn¹t seem to validate on either the client side or the server side My example code: ValidateCheckbox.tml html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; body t:formt:label for=tickMeTick Me /t:label t:checkbox t:id=tickMe t:value=tickMe/t:checkbox t:submit / /t:form /body /html ValidateCheckbox.java public class ValidateCheckbox {@Property @Validate(required) private Boolean tickMe;} Thanks in advance for any help/tips! Ciaran Wood - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- original Nachricht Ende - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Antwort: Re: T5 checkbox component and validation
I'm more looking to have a way to validate a checkbox is checked. I've started work on a custom validator and mixin to add validation functionality to the checkbox. Client side, its working a treat, server side is harder, however... Ciaran On 11/06/2008 5:08pm, nille hammer [EMAIL PROTECTED] wrote: Hi Guys, validate=required on a checkbox does not make sense to me. A chekbox can either be unchecked (resulting in false) or checked (resulting in true). I.e. the validation required can never fail. Could it be you are talking about t:radio and t:radiogroup ? Regards nillehammer - original Nachricht Betreff: Antwort: Re: T5 checkbox component and validation Gesendet: Mi, 11. Jun 2008 Von: Kristian Marinkovic[EMAIL PROTECTED] oops... you're right there is no validate parameter defined for a checkbox. :) you could use the onValidateFormFromFormComponentId event instead g, kris Ciaran Wood [EMAIL PROTECTED] 11.06.2008 16:51 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: T5 checkbox component and validation I just tried that, no luck! It still doesn't do any validation. If it helps I'm using the 5.0.13-SNAPSHOT release. Ciaran Wood On 11/06/2008 3:46pm, Kristian Marinkovic [EMAIL PROTECTED] wrote: the @Validate is only interpreted if used in a bean that is displayed by a BeanEditor(Form). in your case you'd have to apply directly to your checkbox ...t:checkbox t:validate=required g, kris Ciaran Wood [EMAIL PROTECTED] 11.06.2008 16:38 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5 checkbox component and validation Does the checkbox component provided with tapestry support validation? (via the @Validate annotation?) I¹m trying it and it doesn¹t seem to validate on either the client side or the server side My example code: ValidateCheckbox.tml html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; body t:formt:label for=tickMeTick Me /t:label t:checkbox t:id=tickMe t:value=tickMe/t:checkbox t:submit / /t:form /body /html ValidateCheckbox.java public class ValidateCheckbox {@Property @Validate(required) private Boolean tickMe;} Thanks in advance for any help/tips! Ciaran Wood - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- original Nachricht Ende - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Antwort: Re: T5 checkbox component and validation
validate=required on a checkbox does not make sense to me. It makes sense if you have a checkbox that implies that you have read a license agreement, are over 13 etc. To me having required for a checkbox would mean that it was checked. Josh On Wed, Jun 11, 2008 at 9:08 AM, nille hammer [EMAIL PROTECTED] wrote: Hi Guys, validate=required on a checkbox does not make sense to me. A chekbox can either be unchecked (resulting in false) or checked (resulting in true). I.e. the validation required can never fail. Could it be you are talking about t:radio and t:radiogroup ? Regards nillehammer - original Nachricht Betreff: Antwort: Re: T5 checkbox component and validation Gesendet: Mi, 11. Jun 2008 Von: Kristian Marinkovic[EMAIL PROTECTED] oops... you're right there is no validate parameter defined for a checkbox. :) you could use the onValidateFormFromFormComponentId event instead g, kris Ciaran Wood [EMAIL PROTECTED] 11.06.2008 16:51 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: T5 checkbox component and validation I just tried that, no luck! It still doesn't do any validation. If it helps I'm using the 5.0.13-SNAPSHOT release. Ciaran Wood On 11/06/2008 3:46pm, Kristian Marinkovic [EMAIL PROTECTED] wrote: the @Validate is only interpreted if used in a bean that is displayed by a BeanEditor(Form). in your case you'd have to apply directly to your checkbox ...t:checkbox t:validate=required g, kris Ciaran Wood [EMAIL PROTECTED] 11.06.2008 16:38 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5 checkbox component and validation Does the checkbox component provided with tapestry support validation? (via the @Validate annotation?) I¹m trying it and it doesn¹t seem to validate on either the client side or the server side My example code: ValidateCheckbox.tml html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; body t:formt:label for=tickMeTick Me /t:label t:checkbox t:id=tickMe t:value=tickMe/t:checkbox t:submit / /t:form /body /html ValidateCheckbox.java public class ValidateCheckbox {@Property @Validate(required) private Boolean tickMe;} Thanks in advance for any help/tips! Ciaran Wood - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- original Nachricht Ende - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [4.1] Checkbox component updates value to false regardless of selection
Ulrich Stärk schrieb: ... Are you sure that those properties really are set to false upon form submission and that it's not your business logic behaving strangely? Try to add some debug output to your formSubmit method to make sure. You are right. I stripped down the page and template until there was nothing more than the two checkboxes and - it works. Thanks for your kind help and sorry for polluting the list with Tapestry unrelated issues. Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[4.1] Checkbox component updates value to false regardless of selection
Hello, I have a problem with what I would consider a very basic use case: There's a component: input jwcid=[EMAIL PROTECTED] displayName=literal:Hotels value=ognl:reservationQuery.searchForHotels/ label jwcid=@FieldLabel field=component:doHotelSearchCheckboxHotels/label Unfortunatly reservationQuery.searchForHotels is updated to 'false' in the rewind phase, no matter whether the checkbox was selected or not. Is there something wrong with my component definition? Thanks, Andy -- Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [4.1] Checkbox component updates value to false regardless of selection
no - i dont see any problems... What happens if you update a simple property on your page? i.e. input jwcid=[EMAIL PROTECTED] displayName=literal:Hotels value=ognl:searchForHotelsProperty/ Also, which 4.1 version is this with? On 2/18/08, Andy Pahne [EMAIL PROTECTED] wrote: Hello, I have a problem with what I would consider a very basic use case: There's a component: input jwcid=[EMAIL PROTECTED] displayName=literal:Hotels value=ognl:reservationQuery.searchForHotels/ label jwcid=@FieldLabel field=component:doHotelSearchCheckboxHotels/label Unfortunatly reservationQuery.searchForHotels is updated to 'false' in the rewind phase, no matter whether the checkbox was selected or not. Is there something wrong with my component definition? Thanks, Andy -- Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [4.1] Checkbox component updates value to false regardless of selection
Bind the value property of your checkbox to a page property. E.g. in your page class: public abstract boolean isChecked(); public abstract void setChecked(boolean checked); and in your template: input jwcid=[EMAIL PROTECTED] displayName=literal:Hotels value=ognl:checked/ label jwcid=@FieldLabel field=component:doHotelSearchCheckboxHotels/label Uli Am Mo, 18.02.2008, 13:03, schrieb Andy Pahne: Hello, I have a problem with what I would consider a very basic use case: There's a component: input jwcid=[EMAIL PROTECTED] displayName=literal:Hotels value=ognl:reservationQuery.searchForHotels/ label jwcid=@FieldLabel field=component:doHotelSearchCheckboxHotels/label Unfortunatly reservationQuery.searchForHotels is updated to 'false' in the rewind phase, no matter whether the checkbox was selected or not. Is there something wrong with my component definition? Thanks, Andy -- Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [4.1] Checkbox component updates value to false regardless of selection
Also, which 4.1 version is this with? It's 4.1.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [4.1] Checkbox component updates value to false regardless of selection
But iit does not work with 4.1.5, either. Andy Pahne schrieb: Also, which 4.1 version is this with? It's 4.1.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [4.1] Checkbox component updates value to false regardless of selection
I tried that, but the page property is updated to false, regardless of the checkbox selection. Andy Ulrich Stärk schrieb: Bind the value property of your checkbox to a page property. E.g. in your page class: public abstract boolean isChecked(); public abstract void setChecked(boolean checked); and in your template: input jwcid=[EMAIL PROTECTED] displayName=literal:Hotels value=ognl:checked/ label jwcid=@FieldLabel field=component:doHotelSearchCheckboxHotels/label Uli Am Mo, 18.02.2008, 13:03, schrieb Andy Pahne: Hello, I have a problem with what I would consider a very basic use case: There's a component: input jwcid=[EMAIL PROTECTED] displayName=literal:Hotels value=ognl:reservationQuery.searchForHotels/ label jwcid=@FieldLabel field=component:doHotelSearchCheckboxHotels/label Unfortunatly reservationQuery.searchForHotels is updated to 'false' in the rewind phase, no matter whether the checkbox was selected or not. Is there something wrong with my component definition? Thanks, Andy -- Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andy Pahne System Architektur Software Design net22 GmbH Ehrenbergweg 24 32760 Detmold http://www.net22.de Email [EMAIL PROTECTED] Telefon +49 (5231) 58 06 40 Mobil +49 (174) 171 68 70 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [4.1] Checkbox component updates value to false regardless of selection
That's weird... I have so many checkboxes working here... Perhaps you're binding the same object somewhere else? On 2/18/08, Andy Pahne [EMAIL PROTECTED] wrote: I tried that, but the page property is updated to false, regardless of the checkbox selection. Andy Ulrich Stärk schrieb: Bind the value property of your checkbox to a page property. E.g. in your page class: public abstract boolean isChecked(); public abstract void setChecked(boolean checked); and in your template: input jwcid=[EMAIL PROTECTED] displayName=literal:Hotels value=ognl:checked/ label jwcid=@FieldLabel field=component:doHotelSearchCheckboxHotels/label Uli Am Mo, 18.02.2008, 13:03, schrieb Andy Pahne: Hello, I have a problem with what I would consider a very basic use case: There's a component: input jwcid=[EMAIL PROTECTED] displayName=literal:Hotels value=ognl:reservationQuery.searchForHotels/ label jwcid=@FieldLabel field=component:doHotelSearchCheckboxHotels/label Unfortunatly reservationQuery.searchForHotels is updated to 'false' in the rewind phase, no matter whether the checkbox was selected or not. Is there something wrong with my component definition? Thanks, Andy -- Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andy Pahne System Architektur Software Design net22 GmbH Ehrenbergweg 24 32760 Detmold http://www.net22.de Email [EMAIL PROTECTED] Telefon +49 (5231) 58 06 40 Mobil +49 (174) 171 68 70 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [4.1] Checkbox component updates value to false regardless of selection
Nope Andreas Andreou schrieb: That's weird... I have so many checkboxes working here... Perhaps you're binding the same object somewhere else? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [4.1] Checkbox component updates value to false regardless of selection
it might be the right time now to post your complete page class and page template before we start doing wild guesses... Uli Am Mo, 18.02.2008, 15:34, schrieb Andy Pahne: Nope Andreas Andreou schrieb: That's weird... I have so many checkboxes working here... Perhaps you're binding the same object somewhere else? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [4.1] Checkbox component updates value to false regardless of selection
Ulrich Stärk schrieb: it might be the right time now to post your complete page class and page template before we start doing wild guesses... Here you are: Search2.java: --- public abstract class Search2 extends BaseBookingPage implements PageBeginRenderListener { @InitialValue(ognl:true) @Persist public abstract boolean isSearchForHotels(); public abstract void setSearchForHotels(boolean doIt); @InitialValue(ognl:true) @Persist public abstract boolean isSearchForHolidayHomes(); public abstract void setSearchForHolidayHomes(boolean doIt); @Component( type = Form, id = bookingForm, bindings = { listener=ognl:listeners.submitForm, delegate=ognl:beans.delegate, clientValidationEnabled=ognl:false }) public abstract IComponent getBookingForm(); /* (non-Javadoc) * @see org.apache.tapestry.event.PageBeginRenderListener#pageBeginRender(org.apache.tapestry.event.PageEvent) */ public void pageBeginRender(PageEvent arg0) { assertReservationNotLocked(); initializeArrivelDate(); initializeDepartureDate(); //if (passengerModel == null) { //passengerModel = new IntegerPropertySelectionModel(1, 8); //} } private void initializeArrivelDate() { if(getArrivalDate() == null) { Date arrival = DateUtil.addDays(DateUtil.getTodaysMidnight(), getManager().getReservationStartDateOffsetDays()); setArrivalDate(arrival); } } private void initializeDepartureDate() { if(getDepartureDate() == null) { Date departure = DateUtil.addDays(DateUtil.getTodaysMidnight(), getManager().getReservationStartDateOffsetDays() + 1); setDepartureDate(departure); } } /** * Listener-Methode: Formular-Übermittlung: ReservationQuery-Objekt mit * den Eingabedaten des Kunden befüllen. * p * Noch mache ich die Validierung hier von Hand. * */ public IPage submitForm() { assertReservationNotLocked(); ReservationQuery query = getReservationQuery(); // An- und Abreise query.setArrivalDate(getArrivalDate()); query.setDepartureDate(getDepartureDate()); calculateNights(query); query.setLocationSearchTerm(getLocationSearchTerm()); query.setPassengers(getPassengerQty()); // Art der Objekte, die gesucht werden query.setSearchForHotels(isSearchForHotels()); query.setSearchForHolidayHomes(isSearchForHolidayHomes()); // Validierung ausgelagert IValidationDelegate delegate = getDelegate(); validate(delegate); if(isInError()) { return null; } return getNextPage().startNewSearch(); } protected void calculateNights(ReservationQuery query) { DateTime arrival = new DateTime(query.getArrivalDate()); DateTime departure = new DateTime(query.getDepartureDate()); Days days = Days.daysBetween(arrival, departure); int nights = days.getDays(); query.setNights(nights); } /** * Manuelles Validieren der Eingabedaten */ protected void validate(IValidationDelegate delegate) { int days = getManager().getReservationStartDateOffsetDays(); if(getArrivalDate().before(DateUtil.daysFromToday(days - 1))) { // arrivalDate ist zu früh delegate.record(getArrivalDatePicker(), Buchungen m\u00fcssen mindestens + days + Tage in der Zukunft liegen); } if(getReservationQuery().getNights() == null || getReservationQuery().getNights() = 0 ) { delegate.record(getArrivalDatePicker(), Bitte die Daten für An- und Abreise \u00fcberpr\u00fcfen); } if(isSearchForHotels() == false isSearchForHolidayHomes() == false) { setErrorMessage(Bitte w\u00e4hlen Sie aus, welche Unterkunftsarten + gesucht werden sollen); } } /** Anzahl der Passagiere */ public IPropertySelectionModel passengerModel = new IntegerPropertySelectionModel(1, 8); /** Datum der Ankunft */ @Persist public abstract Date getArrivalDate(); public abstract void setArrivalDate(Date arrivalDate); /** Datum der Abreise */ @Persist public abstract Date getDepartureDate(); public abstract void setDepartureDate(Date departureDate); /** Anzahl der mitreisenden Passagiere */ @Persist public abstract Integer getPassengerQty(); /** Suchbegriff für die Suche nach einer Location */ @Persist public abstract String getLocationSearchTerm(); public abstract void setLocationSearchTerm(String term);
Re: [4.1] Checkbox component updates value to false regardless of selection
Andy Pahne schrieb: Ulrich Stärk schrieb: it might be the right time now to post your complete page class and page template before we start doing wild guesses... Here you are: Unless you are calling setSearchForHotels() or setSearchForHolidayHomes() in your parent class your code should work just fine. I can see nothing wrong with it. Are you sure that those properties really are set to false upon form submission and that it's not your business logic behaving strangely? Try to add some debug output to your formSubmit method to make sure. Uli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Create a custom checkbox component
Yes, there's a value parameter you can bind some page method to so that you can easily get/set the !Object in the hidden field from the page (you'll have to cast the object obviously). I think you'll have all your checkboxes inside a For component so I guess you'll iterate over a collection and have something like component id=userList type=For binding name=source value=nodes/ binding name=value value=currentNode/ /component component id=nodeCheckBox type=Checkbox binding name=value value=currentNode.selected/ /component component id=nodeParent type=Hidden binding name=value value=currentNode.parent/ /component component id=nodeChild type=Hidden binding name=value value=currentNode.child/ /component Well I think guessed too much but as you haven't provided much information :-) Depending on your model and on what you have to achieve things could be even simpler as maybe you already have parent/child informations in node itself On 8/10/07, Mateus Lucio dos Santos [EMAIL PROTECTED] wrote: I like the idea!! But when the browser render this component will I be able to access those attributes? Martino Piccinato wrote: I think you could just make a component using a normal checkbox PLUS two Hidden components ( http://tapestry.apache.org/tapestry4.1/components/form/hidden.html) containing the parent/child references. Just extend BaseComponent and use one Checkbox plus two Hidden in your new component. Adding strange, non standard, attributes to tags your browsers will see is never a good idea :-) On 8/10/07, Mateus Lucio dos Santos [EMAIL PROTECTED] wrote: Hi! I need to display a checkbox in a webpage. This checkbox work as a node in a treeview, so i need to save in the checkbox tag which node is his parent and which node are his children. I tried to simply add two attributes to the checkbox tag like this input id=test type=checkbox parent=parent children=children / it works just fine in I.E but firefox doesn't recognize the parent and children attributes, thats why i'm trying to solve this creating a component that has those attributes. I'm a beginner using tapestry so i'm clueless about how to create a component that works the this way. Can any one send me some material or explain me how to create this component? Thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Create a custom checkbox component
I think you could just make a component using a normal checkbox PLUS two Hidden components ( http://tapestry.apache.org/tapestry4.1/components/form/hidden.html) containing the parent/child references. Just extend BaseComponent and use one Checkbox plus two Hidden in your new component. Adding strange, non standard, attributes to tags your browsers will see is never a good idea :-) On 8/10/07, Mateus Lucio dos Santos [EMAIL PROTECTED] wrote: Hi! I need to display a checkbox in a webpage. This checkbox work as a node in a treeview, so i need to save in the checkbox tag which node is his parent and which node are his children. I tried to simply add two attributes to the checkbox tag like this input id=test type=checkbox parent=parent children=children / it works just fine in I.E but firefox doesn't recognize the parent and children attributes, thats why i'm trying to solve this creating a component that has those attributes. I'm a beginner using tapestry so i'm clueless about how to create a component that works the this way. Can any one send me some material or explain me how to create this component? Thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Create a custom checkbox component
Hi! I need to display a checkbox in a webpage. This checkbox work as a node in a treeview, so i need to save in the checkbox tag which node is his parent and which node are his children. I tried to simply add two attributes to the checkbox tag like this input id=test type=checkbox parent=parent children=children / it works just fine in I.E but firefox doesn't recognize the parent and children attributes, thats why i'm trying to solve this creating a component that has those attributes. I'm a beginner using tapestry so i'm clueless about how to create a component that works the this way. Can any one send me some material or explain me how to create this component? Thanks in advance
Re: Checkbox component
jwcid=[EMAIL PROTECTED] Tapestry will automatically assign it test1Select as the id in the HTML, I believe. On 9/15/06, Peter Dawn [EMAIL PROTECTED] wrote: guys, am using the checkbox component within my form. now i have a number of checkboxes, hence i have an option to select all or none of the checkboxes. the user clicks on the link and depending upon the link either all or none of the checkboxes get ticked off. now obviously for me to reference these checkboxes, i need to name them. so i have something like this, input type=checkbox jwcid=@Checkbox selected=ognl:test1Select name=test1Select value=testPage/ and within my js i have. document.getElementById['test1Select'].checked=true; but its not working. and when i look at the source code, the name of the checkbox is $Checkbox0 (tapestry is generating these names based on the checkbox component). so my issue is, how can i reference these individual checkboxes with names. any help pls. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Checkbox component
guys, am using the checkbox component within my form. now i have a number of checkboxes, hence i have an option to select all or none of the checkboxes. the user clicks on the link and depending upon the link either all or none of the checkboxes get ticked off. now obviously for me to reference these checkboxes, i need to name them. so i have something like this, input type=checkbox jwcid=@Checkbox selected=ognl:test1Select name=test1Select value=testPage/ and within my js i have. document.getElementById['test1Select'].checked=true; but its not working. and when i look at the source code, the name of the checkbox is $Checkbox0 (tapestry is generating these names based on the checkbox component). so my issue is, how can i reference these individual checkboxes with names. any help pls. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]