ed.shee...@gmail.com
unread,Apr 26, 2018, 10:10:22 PM4/26/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DataFX
I'm newbie in DataFX ,I'm trying shared a JFXDialog between two controllers so in first controller I have :
@ViewController(value = "/com/javafx/pattern/mvc/view/parent/fxml/SignUp.fxml")
public class SignUpController {
.......
.......
@ActionMethod("onClickSignUp")
public void showSignUpForm() throws IOException, FlowException {
ViewConfiguration configuration = new ViewConfiguration();
configuration.setResources(ResourceBundleRegister.SIGN_UP_FORM_BUNDLE_ENG);
StackPane stackPane = FlowContextController.buildFlow(RegistrationController.class, configuration, context, STYLE_SHEET); //FlowContextController has a reponsibilty of flow mangement
JFXDialog registrationDialog = new JFXDialog();
registrationDialog.setContent(stackPane);
registrationDialog.setDialogContainer((StackPane) rootTabPane.getScene().getRoot());
registrationDialog.setTransitionType(JFXDialog.DialogTransition.LEFT);
registrationDialog.show();
context.register(registrationDialog);
}
...
.......
....
}
In second controller "ErrorController" (has not a view ) ,It is a standart class can display errors ....
public class SharedErrorController {
public static void pinErrorPopOver(Node node, String errorMessage) {
JFXDialog dialog = FlowContextController.getFlowHandler().getFlowContext().getRegisteredObject(JFXDialog.class); //My question is about this line
//Hide error popover in case of leaving window
node.getScene().getWindow().focusedProperty().addListener((ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) -> {
if (!newValue) {
errorPopOver.hide();
}
});
..
..............
}
}
With this piece of code am I in DataFX concepts ? if not ,please give a sample how to share a node between controller and other class . Thank you .