hi all,

Anybody knows how to change the displayed name of an AjaxSubmitButton?

I just tried to do a .setMode(new ResourceModel(bla bla.... But it didn't
work.


I have an input:

<input type="submit" value="create" wicket:id="createButton">

with the following code:

//create the ajax submit button
     AjaxSubmitButton ajaxButton = new AjaxSubmitButton("createButton",
form) {
        protected void onSubmit(AjaxRequestTarget target, Form form) {
           if(dossierModel.getId()!=null&&dossierModel.getId().length()>0){
              modifyDossier();
              //Print fields
              info("Changed: "+dossierModel.printFields());
           }else{
              createDossier();
              //Print fields
              info("New: "+dossierModel.printFields());
           }

           target.addComponent(feedback);
        }
        protected void onError(AjaxRequestTarget target, Form form) {

           // repaint the feedback panel so errors are shown
           target.addComponent(feedback);
        }
        //add model for new or modify button
        //very ugly statement, but possible due to wicket's architecture
     };

     if(dossierId==null){
        ajaxButton.setModel(new ResourceModel("fields.btnNew"));
     }else{
        ajaxButton.setModel(new ResourceModel("fields.btnModify"));
     }
     //add submit button
     form.add(ajaxButton);



regards,
f(t)
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to