Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fragments V Views #11

Open
ahinchman1 opened this issue Apr 3, 2018 · 1 comment
Open

Fragments V Views #11

ahinchman1 opened this issue Apr 3, 2018 · 1 comment

Comments

@ahinchman1
Copy link
Owner

A View has an injectable class for field assignment, but Fragments do not.

At the moment, I'm left with two unsavory choices:

  1. use a fragment to recycle views, but heavy load drag and drop functionality in every instance (and mashing together VC) or
  2. keep the V and C separated and clean but using a view means I cannot recall a scope on init (edited)

I'll let you know what solution I stumble upon, but some thoughts I have, and in no particular ranking of bad to good or the likes, are the following:

  • a fragment that uses find seems to have a java stack overload, as expect for something this heavy-duty when using a controller as a global field. Scope in scope. sounds terrible right off the bat
  • eventbus - trigger a call for a new scope upon switching back to the view
  • create a special component similar to a fragment, but only for the view so a lazy load can be called once for class injection, but the view itself clears every time
@ahinchman1
Copy link
Owner Author

ahinchman1 commented Apr 3, 2018

One proposal from @bekwam: comparing some javafx code to tornadofx... you could also make the single instance selected property part of the view model. A selection on the TableView (master) sets single instance which can be picked up through injection in the details fragment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant