We are porting a huge CRUD type application that relies on
many popup windows for entering the ''detail'' side of master-detail
relationships. The design can't change - have to keep the popups,
or at least something that ''looks'' like a popup to the end user.
These detail popups typically have several ComboBoxes that must be
sourced dynamically from a database. If I embed the data service to
load these combo items in each respective popup, then there is a
noticeable delay for the end user while the pop up initializes.
This is ok once (the first time), but not every time they try to
edit a detail record. We've initially solved it by loading the
ComboBox data into the parent, and then passing a reference to the
popup. That works, but it makes the parent component bloated with
code that really belongs in the popup, and then we have to
duplicate code on any screen that needs that popup. And there are
dozens of these popups on each screen. What are my options? I
basically need to initialize a child window once (have the
ComboBoxes loaded) no matter how many times the user opens and
closes it. I'm using TitleWindows for these popups at the moment.
Thanks for any ideas.Popup vs. ... what are my options?
well thats quite easy, have a seperate service that returns
items for combo boxex etc make it as dataprovider
and call servie only once at creationcomplete and then reuse
resultPopup vs. ... what are my options?
That's what we're doing - putting the service is in the
parent window - but as I said, it adds a lot of code to the parent
window that ''doesn't belong there'', and then we have to do it all
over again when we use the popup on another screen. And the
communication between all the various popups and the parent is
getting out of control. Very messy. We have this working, but what
we're looking for is a cleaner, simpler approach. Has anyone done
this in a way that you can somehow encapsulate all interactions
that are required? For example, say you had a ''Comment Editor'' that
you needed to drop into many different screens, and have it come up
as a popup. On this editor was a ''Comment Type'' combo box that was
sourced dynamically from a database. The way we have it set up now,
every parent component that uses it would have to initialize the
comment type list. And ditto for every other popup. I'm looking for
some ideas on how to make this sort of thing reusable with a
minimal amount of wiring. Is there a way, maybe, to make some sort
of global ''List Manager'' that handles initialization of all the
ComboBox sources?
We went with the ''List Manager'' concept, by creating a class
that encapsulates all data retrievals needed by every ComboBox in
the system. These are lazy loaded, in the sense that if a screen
needs, say, list A, B, and C, that screen submits those requests to
a queue in the ListManager. When all the list data are retrieved
from the database (they may already be there from a previous call),
the ListManager raises an event and the caller knows the data is
ready. The serialization is important, because the Combos have to
be sourced before you can set the value to display. The ListManager
holds only the data, as ArrayCollections converted from XML, and is
used as a singleton. The ArrayCollections are made available to any
screen that needs to source a combo box.
Subscribe to:
Post Comments
(Atom)
No comments:
Post a Comment