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
You currently can create custom controls as FXML views by using the "root" and "codeBehind" methods of the FxmlViewStep. But if you want to use the same scheme with pure Java views, this does not work because the JavaViewStep does not have the corresponding "codeBehind" method. It would be nice if such a method could be added.
Here is a code example which shows the problem:
public class AboutView extends HBox implements JavaView<AboutViewModel> {
@InjectViewModel
private AboutViewModel viewModel;
@InjectResourceBundle
private ResourceBundle resources;
public AboutView() {
String aboutText;
try {
FluentViewLoader.javaView(AboutView.class).codeBehind(this).load(); // Here is the problem
aboutText = resources.getString("about.text");
} catch (Exception e) {
aboutText = "???";
}
Label description = new Label(aboutText);
setSpacing(10);
setPadding(new Insets(20));
getChildren().add(description);
}
}
The text was updated successfully, but these errors were encountered:
Hi,
thanks for your request. In our projects we were almost only using fxml views in the past so our focus wasn't on the java-only feature. But of cause your request is valid and I will add this feature in the next release.
The implementation of this was surprisingly easy. You can try it with the version 1.5.0-SNAPSHOT that is pushed to the maven central snapshot repo. Please give feedback if everything works fine for your use case.
You currently can create custom controls as FXML views by using the "root" and "codeBehind" methods of the FxmlViewStep. But if you want to use the same scheme with pure Java views, this does not work because the JavaViewStep does not have the corresponding "codeBehind" method. It would be nice if such a method could be added.
Here is a code example which shows the problem:
The text was updated successfully, but these errors were encountered: