Access Data or Controller via MDI
Posted: Fri Mar 30, 2018 12:39 pm
Hi,
Not sure if anyone is still active on this forum, but decided to ask anyway.
Just playing with "MDI" using the JVx library.
Been able to get most of my test skeleton working, however I have run into an issue of how to access a model/controller via an "FXInternalWindow"?
ie, I have a "Menu/Toolbar/FXDesktopPane/Footer" style app, which can create new "FXInternalWindow"s, and during the creation, I create my backend Model/Controller and from the controller generate a Group which I can embed with the "FXInternalWindow", but how to I link the "FXInternalWindow" and the controller together efficiently.
The reason behind this, is when I have a window selected, I need to be able to have a button within a toolbar to be able to save the active (or last active, as focus is lost when you click a menu or toolbar) window's model, also to be able to perform various other tasks.
Initially I was thinking of either creating a observable list, with two fields, one with the "FXInternalWindow" reference and one with the controller, so I can find the active window, and compare against the list to get my controller.
Second option was to "extend" "FXInternalWindow" to a custom "FXInternalWindowWithController" and add in the logic to store a reference to the controller etc...
So, just wondering, what is the best way, or is there other "better" ways...
Many thanks in advance.
Cheers.
Not sure if anyone is still active on this forum, but decided to ask anyway.
Just playing with "MDI" using the JVx library.
Been able to get most of my test skeleton working, however I have run into an issue of how to access a model/controller via an "FXInternalWindow"?
ie, I have a "Menu/Toolbar/FXDesktopPane/Footer" style app, which can create new "FXInternalWindow"s, and during the creation, I create my backend Model/Controller and from the controller generate a Group which I can embed with the "FXInternalWindow", but how to I link the "FXInternalWindow" and the controller together efficiently.
The reason behind this, is when I have a window selected, I need to be able to have a button within a toolbar to be able to save the active (or last active, as focus is lost when you click a menu or toolbar) window's model, also to be able to perform various other tasks.
Initially I was thinking of either creating a observable list, with two fields, one with the "FXInternalWindow" reference and one with the controller, so I can find the active window, and compare against the list to get my controller.
Second option was to "extend" "FXInternalWindow" to a custom "FXInternalWindowWithController" and add in the logic to store a reference to the controller etc...
So, just wondering, what is the best way, or is there other "better" ways...
Many thanks in advance.
Cheers.