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
JavaBot
JavaBot6mo ago
This post has been reserved for your question.
Hey @Koblížkáč! Please use /close or the Close 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.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
stechy1
stechy16mo ago
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.
Koblížkáč
KoblížkáčOP6mo ago
is this the standard approach?
stechy1
stechy16mo ago
Using the setter method? Yes, I would say it is a standard approach
JavaBot
JavaBot6mo ago
💤 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.
Want results from more Discord servers?
Add your server