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
<[email protected]> wrote:
> Maybe to it with an attribute modifier.. I cant remember ajaxbutton..
>
> 2009/5/6 Per Newgro <[email protected]>:
>> Maybe you could add two buttons and set the other visible?
>>
>> Cheers
>> Per
>>
>> ---------------------------------------------------------------------
>> 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]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to