Thanks for the replies. Peter: that won't work - the contents of the textarea are not transferred to the wicket app without some javascript / ajax magic happening under the hood
Pedro: Using that I could let the component listen to onchange event but that would cause an unacceptable load. I really want the model update action to be initiated by the link. Or can I let clicking the link generate an event which then will be picked up by the component? Antoine On Wed, Oct 21, 2009 at 2:03 PM, Pedro Santos <[email protected]> wrote: > you can add an AjaxFormComponentUpdatingBehavior on your textarea to keep > the model updated > > On Wed, Oct 21, 2009 at 9:58 AM, Peter Arnulf Lustig <[email protected]>wrote: > >> Have you tried assign a Model to the component which needs to be updated? >> >> Model<String> model = new Model<String>(""); >> ---> assign to the component of the form. >> i.e. final TextField tf = new TextField("txt", model); >> >> in Link Execution >> -> tf.setModel(mode); >> >> >> >> ----- Ursprüngliche Mail ---- >> Von: Antoine van Wel <[email protected]> >> An: [email protected] >> Gesendet: Mittwoch, den 21. Oktober 2009, 13:22:01 Uhr >> Betreff: how to update a form model when clicking a link >> >> On a page there's a form with a textarea. >> Somewhere else on the page there is a wicket link, which is not inside the >> form. >> The user types something in the textarea and then presses the link. >> >> Now what I'd like to achieve is when the code of the link is executed, >> the model of the form is up-to-date - so what the user has typed, >> should be inside the model. The form should not be submitted. >> >> >> Any suggestions how this can be done - preferably without writing >> Javascript? >> >> >> >> Thanks, >> Antoine >> >> >> -- >> take your photos everywhere you go - https://www.memolio.com >> follow us on Twitter - http://twitter.com/Memolio >> >> --------------------------------------------------------------------- >> 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] >> >> > > > -- > Pedro Henrique Oliveira dos Santos > -- take your photos everywhere you go - https://www.memolio.com follow us on Twitter - http://twitter.com/Memolio --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
