You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a ViewModel has a single method with the signature of public void initialize() which is also annotated with @Initialize then this method will be invoked two times by the ViewLoader.
publicclassMyViewModelimplementsViewModel {
@Initializepublicvoidinitialize() {
System.out.println("Will be invoked twice");
}
}
The reason for this is that mvvmFX supports the naming convention of standard JavaFX and has also an annotation for initialization.
However, this is can lead to errors because double initialization is most likely a bug. To fix this we should invoke the initialize method only once.
The text was updated successfully, but these errors were encountered:
If a ViewModel has a single method with the signature of
public void initialize()
which is also annotated with@Initialize
then this method will be invoked two times by the ViewLoader.The reason for this is that mvvmFX supports the naming convention of standard JavaFX and has also an annotation for initialization.
However, this is can lead to errors because double initialization is most likely a bug. To fix this we should invoke the initialize method only once.
The text was updated successfully, but these errors were encountered: