Re: Mutually dependent component and how to update a textfield when a link is clicked
Thanks John, that page was very useful. :) On Wed, Apr 22, 2009 at 2:57 AM, John Krasnay wrote: > Hi Liam, > > Check out this page: > > http://cwiki.apache.org/WICKET/conditional-validation.html > > It has a bunch of recipes for interactions between components, e.g. > requiring a text field only if a checkbox is checked or a certain submit > button was used. Sounds similar to what you need to do. > > jk > > On Tue, Apr 21, 2009 at 09:40:09AM -0500, Jeremy Thomerson wrote: >> As far as sharing models - just make sure both components' model reads from >> the same backing object - be it the component itself or a domain object. >> >> As far as submitting the value - basically there are two ways - just like if >> you had a plain HTML page - form submission or javascript that appends the >> value to the end of a GET url. >> >> -- >> Jeremy Thomerson >> http://www.wickettraining.com >> >> >> >> On Tue, Apr 21, 2009 at 5:21 AM, Liam Clarke-Hutchinson > > wrote: >> >> > Hi, >> > >> > Come across a few situations where there are two components are >> > reliant on each other, say a checkbox's model value that a textfield >> > uses in its isDisabled method, and the textfield needs the >> > abstractCheckboxModel to re-evaluate a particular value on a given >> > response. >> > >> > For the first bit, we tend to just move the dependency onto a local >> > variable or field, and for the second, we've decided to make the >> > changes on the underlying entity model that they were all holding >> > models on instead, as a workaround, but it's getting a bit dicey - I >> > get the feeling this is the sort of thing that CPMs can help well with >> > - where you've got multiple components needing to share state between >> > them? >> > >> > One last thing, if I have a textfield that I want to post the value to >> > the server of when a link is clicked, and only that textfield for only >> > that link, how do I model this? So far using a small form for each >> > pair and then calling submit only on that form seems to be the way to >> > do it? >> > >> > Regards, >> > >> > Liam Clarke >> > >> > - >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> > For additional commands, e-mail: users-h...@wicket.apache.org >> > >> > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Mutually dependent component and how to update a textfield when a link is clicked
Hi Liam, Check out this page: http://cwiki.apache.org/WICKET/conditional-validation.html It has a bunch of recipes for interactions between components, e.g. requiring a text field only if a checkbox is checked or a certain submit button was used. Sounds similar to what you need to do. jk On Tue, Apr 21, 2009 at 09:40:09AM -0500, Jeremy Thomerson wrote: > As far as sharing models - just make sure both components' model reads from > the same backing object - be it the component itself or a domain object. > > As far as submitting the value - basically there are two ways - just like if > you had a plain HTML page - form submission or javascript that appends the > value to the end of a GET url. > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Tue, Apr 21, 2009 at 5:21 AM, Liam Clarke-Hutchinson > wrote: > > > Hi, > > > > Come across a few situations where there are two components are > > reliant on each other, say a checkbox's model value that a textfield > > uses in its isDisabled method, and the textfield needs the > > abstractCheckboxModel to re-evaluate a particular value on a given > > response. > > > > For the first bit, we tend to just move the dependency onto a local > > variable or field, and for the second, we've decided to make the > > changes on the underlying entity model that they were all holding > > models on instead, as a workaround, but it's getting a bit dicey - I > > get the feeling this is the sort of thing that CPMs can help well with > > - where you've got multiple components needing to share state between > > them? > > > > One last thing, if I have a textfield that I want to post the value to > > the server of when a link is clicked, and only that textfield for only > > that link, how do I model this? So far using a small form for each > > pair and then calling submit only on that form seems to be the way to > > do it? > > > > Regards, > > > > Liam Clarke > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Mutually dependent component and how to update a textfield when a link is clicked
As far as sharing models - just make sure both components' model reads from the same backing object - be it the component itself or a domain object. As far as submitting the value - basically there are two ways - just like if you had a plain HTML page - form submission or javascript that appends the value to the end of a GET url. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Apr 21, 2009 at 5:21 AM, Liam Clarke-Hutchinson wrote: > Hi, > > Come across a few situations where there are two components are > reliant on each other, say a checkbox's model value that a textfield > uses in its isDisabled method, and the textfield needs the > abstractCheckboxModel to re-evaluate a particular value on a given > response. > > For the first bit, we tend to just move the dependency onto a local > variable or field, and for the second, we've decided to make the > changes on the underlying entity model that they were all holding > models on instead, as a workaround, but it's getting a bit dicey - I > get the feeling this is the sort of thing that CPMs can help well with > - where you've got multiple components needing to share state between > them? > > One last thing, if I have a textfield that I want to post the value to > the server of when a link is clicked, and only that textfield for only > that link, how do I model this? So far using a small form for each > pair and then calling submit only on that form seems to be the way to > do it? > > Regards, > > Liam Clarke > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Mutually dependent component and how to update a textfield when a link is clicked
Hi, Come across a few situations where there are two components are reliant on each other, say a checkbox's model value that a textfield uses in its isDisabled method, and the textfield needs the abstractCheckboxModel to re-evaluate a particular value on a given response. For the first bit, we tend to just move the dependency onto a local variable or field, and for the second, we've decided to make the changes on the underlying entity model that they were all holding models on instead, as a workaround, but it's getting a bit dicey - I get the feeling this is the sort of thing that CPMs can help well with - where you've got multiple components needing to share state between them? One last thing, if I have a textfield that I want to post the value to the server of when a link is clicked, and only that textfield for only that link, how do I model this? So far using a small form for each pair and then calling submit only on that form seems to be the way to do it? Regards, Liam Clarke - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org