Menu

ViewCallback question

Help
2010-05-11
2013-04-29
  • jkoulwebster

    jkoulwebster - 2010-05-11

    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

     
  • Luca Molino

    Luca Molino - 2010-05-11

    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.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.