<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: ËÎÌå, sans-serif;"><div>Hi, everyone:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>I add a button, named backup in the Template Tab, </div><div>And the click event is ok. </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Now I want add a dialog after clicked the button,</div><div>So, I add a model , but the dialog didn’t display at all.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>So, I want to know is there some necessary class need </div><div>To modify or add?</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>The model code is like this:</div><div>TemplateBackupModel.java</div><div>========================================================</div><div><div>public class TemplateBackupModel extends Model {</div><div><br></div><div> private EntityModel privatePassword;</div><div><br></div><div> public EntityModel getPassword()</div><div> {</div><div> return privatePassword;</div><div> }</div><div><br></div><div> public void setPassword(EntityModel value)</div><div> {</div><div> privatePassword = value;</div><div> }</div><div><br></div><div> public TemplateBackupModel(){</div><div><br></div><div> setPassword(new EntityModel());</div><div><br></div><div> AsyncQuery _asyncQuery = new AsyncQuery();</div><div> _asyncQuery.setModel(this);</div><div> _asyncQuery.asyncCallback = new INewAsyncCallback() {</div><div> @Override</div><div> public void onSuccess(Object model, Object result)</div><div> {</div><div><br></div><div> }</div><div> };</div><div><br></div><div> }</div><div><br></div><div> @Override</div><div> public void eventRaised(Event ev, Object sender, EventArgs args) {</div><div> super.eventRaised(ev, sender, args);</div><div> }</div><div><br></div><div> public boolean validate(){</div><div> return true;</div><div> }</div><div>}</div></div><div>========================================================</div><div><br></div><div>And created a model in the backup button click callback like this£º</div><div>========================================================</div><div><div>public void backup()</div><div> {</div><div><br></div><div> if (getWindow() != null)</div><div> {</div><div> return;</div><div> }</div><div><br></div><div> TemplateBackupModel model = new TemplateBackupModel();</div><div> setWindow(model);</div><div> model.setTitle("TemplateBackup");//$NON-NLS-1$</div><div> model.setHashName("TemplateBackup");//$NON-NLS-1$</div><div><br></div><div><br></div><div> UICommand tempVar = new UICommand("OnBackup", this); //$NON-NLS-1$</div><div> tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok());</div><div> tempVar.setIsDefault(true);</div><div> model.getCommands().add(tempVar);</div><div> UICommand tempVar2 = new UICommand("Cancel", this); //$NON-NLS-1$</div><div> tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel());</div><div> tempVar2.setIsCancel(true);</div><div> model.getCommands().add(tempVar2);</div><div><br></div><div> }</div></div><div>========================================================</div></body></html>