Hi, everyone: I add a button, named backup in the Template Tab, And the click event is ok. Now I want add a dialog after clicked the button, So, I add a model , but the dialog didn’t display at all.
So, I want to know is there some necessary class need To modify or add? The model code is like this: TemplateBackupModel.java ======================================================== public class TemplateBackupModel extends Model { private EntityModel privatePassword; public EntityModel getPassword() { return privatePassword; } public void setPassword(EntityModel value) { privatePassword = value; } public TemplateBackupModel(){ setPassword(new EntityModel()); AsyncQuery _asyncQuery = new AsyncQuery(); _asyncQuery.setModel(this); _asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { } }; } @Override public void eventRaised(Event ev, Object sender, EventArgs args) { super.eventRaised(ev, sender, args); } public boolean validate(){ return true; } } ======================================================== And created a model in the backup button click callback like this: ======================================================== public void backup() { if (getWindow() != null) { return; } TemplateBackupModel model = new TemplateBackupModel(); setWindow(model); model.setTitle("TemplateBackup");//$NON-NLS-1$ model.setHashName("TemplateBackup");//$NON-NLS-1$ UICommand tempVar = new UICommand("OnBackup", this); //$NON-NLS-1$ tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok()); tempVar.setIsDefault(true); model.getCommands().add(tempVar); UICommand tempVar2 = new UICommand("Cancel", this); //$NON-NLS-1$ tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel()); tempVar2.setIsCancel(true); model.getCommands().add(tempVar2); } ========================================================
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel