@PreDestory can't be invoked if defined in parent class, but @PostConstructor can.

32 views
Skip to first unread message

Gogo Cao

unread,
Jan 28, 2015, 6:44:28 AM1/28/15
to dataf...@googlegroups.com
Hi All:

  It seems like Only @PostConstructor can be invoked if defined in parent class. but @PreDestory can't. 


public abstract class BaseWizard {

   @PreDestroy

   public void stop() {

       System.out.println("stop from BaseWizard, current: " + getClass().getSimpleName());
   
}

}



and wizardView3









@FXMLController("wizardView3.fxml")


public class WizardView3Controller {

   @Inject

   private DataModel model = null;

   @PostConstruct

   public void init() {

       this.model.print("wizard #3");

   }


    @PreDestroy

   public void stop() {

       System.out.println("stop from WizardView3Controller");

   }

}



wizard4, extends BaseWizard.









@FXMLController("wizardView4.fxml")


public class WizardView4Controller extends BaseWizard{


    @Inject


    private DataModel model = null;




    @PostConstruct


    public void init() {


        this.model.print("wizard #4");


    }


}


And switch wizard pages. but can only see logs:










stop from WizardView3Controller


ctor: counter = 1 simple value: null


wizard #3: counter = 1 simple value: null


ctor: counter = 1 simple value: null


wizard #4: counter = 1 simple value: null


stop from WizardView3Controller


ctor: counter = 1 simple value: null


wizard #5: counter = 1 simple value: null




No log from wizard4.

I think that's an issue, right? 

The complete codes are in the attachment. Thanks.
datafx-model-inject-error.zip

Hendrik Ebbers

unread,
Jan 28, 2015, 6:53:02 AM1/28/15
to dataf...@googlegroups.com
Yes. Can you please create an issue at bitbucket?

Gogo Cao

unread,
Jan 28, 2015, 6:58:01 AM1/28/15
to dataf...@googlegroups.com
OK, I will do it later. 

And my version is: datafx - 8.0.

One more thing: would please confirm my another post about one day ago? about model property lost issue. 
Thanks.

Hendrik Ebbers

unread,
Jan 28, 2015, 7:21:21 AM1/28/15
to dataf...@googlegroups.com
I will have a look at this later.

Hendrik Ebbers

unread,
Jan 28, 2015, 2:37:56 PM1/28/15
to dataf...@googlegroups.com
I hope to release DataFX 8.1 next week. By doing so the bug will be fixed.
Reply all
Reply to author
Forward
0 new messages