Hi all: From official manual I am told that if soem domian implements ViewCallback then the onShow() method will be invoked when application system startup,I have wrote the example to test,but failed to run it,anyone can help me? MyTab.java
public class MyTab implements ViewCallback{ @CoreField(useRuntimeType=AnnotationConstants.TRUE) @ViewField(label="", render=ViewConstants.RENDER_OBJECTEMBEDDED) Object tabContent; @ViewField(visible=AnnotationConstants.FALSE) PersonMain main; public Object getTabContent() { return tabContent; } public void setTabContent(Object tabContent) { this.tabContent = tabContent; } public PersonMain getMain() { return main; } public void setMain(PersonMain main) { this.main = main; } public void showInstance(Object newContent){ setTabContent(newContent); refresh(); } @ViewAction(visible=AnnotationConstants.FALSE) public void showMain(){ setTabContent(main); main.search(); refresh(); } [b]public void onShow(){ this.main = new PersonMain(this); this.tabContent = this.main; refresh(); }[/b] @ViewAction(visible=AnnotationConstants.FALSE) public void refresh(){ Roma.fieldChanged("tabContent"); } public void onDispose() { // TODO Auto-generated method stub } }
Thanks.
JK.WST
I'm sorry but i can't get what's your problem, and the onShow method is invoked only when your class is showed, not when application starts.
Log in to post a comment.
Hi all:
From official manual I am told that if soem domian implements ViewCallback then the onShow() method will be invoked when application system startup,I have wrote the example to test,but failed to run it,anyone can help me?
MyTab.java
Thanks.
JK.WST
I'm sorry but i can't get what's your problem, and the onShow method is invoked only when your class is showed, not when application starts.