Re: FW: need help urgent......Change label dynamicly
And of course don't forget to add the button or a parent component to the ajaxrequesttarget as well. On Wed, May 6, 2009 at 11:58 AM, Janos Cserep wrote: > AFAIR a button's label comes from it's Model. So you should do: > > new AjaxButton("preview"){ > > public void onSubmit(AjaxRequestTarget target, Form form){ > String label = getModelObject(); // or > getDefaultModelObject(); if 1.4 > if ("click".equals(label) { > getModel().setObject("unclick); // or > getDefaultModel().setObject("unclick") in case you're at 1.4 > } > } > }.setModel("click); > > > On Wed, May 6, 2009 at 11:44 AM, nino martinez wael > wrote: >> Maybe to it with an attribute modifier.. I cant remember ajaxbutton.. >> >> 2009/5/6 Per Newgro : >>> Maybe you could add two buttons and set the other visible? >>> >>> Cheers >>> Per >>> >>> - >>> 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: FW: need help urgent......Change label dynamicly
AFAIR a button's label comes from it's Model. So you should do: new AjaxButton("preview"){ public void onSubmit(AjaxRequestTarget target, Form form){ String label = getModelObject(); // or getDefaultModelObject(); if 1.4 if ("click".equals(label) { getModel().setObject("unclick); // or getDefaultModel().setObject("unclick") in case you're at 1.4 } } }.setModel("click); On Wed, May 6, 2009 at 11:44 AM, nino martinez wael wrote: > Maybe to it with an attribute modifier.. I cant remember ajaxbutton.. > > 2009/5/6 Per Newgro : >> Maybe you could add two buttons and set the other visible? >> >> Cheers >> Per >> >> - >> 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: FW: need help urgent......Change label dynamicly
Maybe to it with an attribute modifier.. I cant remember ajaxbutton.. 2009/5/6 Per Newgro : > Maybe you could add two buttons and set the other visible? > > Cheers > Per > > - > 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: FW: need help urgent......Change label dynamicly
Maybe you could add two buttons and set the other visible? Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
FW: need help urgent......Change label dynamicly
Hello, I want to change the Label for the AjaxButton, when it is clicked. Iam not able to work out this. new AjaxButton("preview"){ public void onSubmit(AjaxRequestTarget target, Form form){ // need to get the label name here...how to get the label name? if(AjaxButton.label.equal("click")) then set label to "Unclick" if "UnClick" then show "click" } Need urgently, stopping my work. Could you please give me hint, how to do this Implementation. Thanks, Praveen --- Begin Message --- Hello, I want to change the Label for the AjaxButton, when it is clicked. Iam not able to work out this. new AjaxButton("preview"){ public void onSubmit(AjaxRequestTarget target, Form form){ if(AjaxButton.label.equal("click")) then set label to "Unclick" if "UnClick" then show "click" } Need urgently, stopping my work. Could you please give me hint, how to do this. Implementation. Thanks, Praveen --- End Message --- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org