Injecting objects into custom controls FXML
How can that be done? i cant pass it through ctor as it doesnt allow ctors with any params in fxml
5 Replies
⌛
This post has been reserved for your question.
Hey @Koblížkáč! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Hi, it is possible to implement a custom control factory and then inject custom objects, but I would recommend simply to let create a control in the standard way and then simply inject the object you need by the setter method of the control.
is this the standard approach?
Using the setter method? Yes, I would say it is a standard approach
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.