Auto selection
- From: "tailorma_de" <tailormade@xxxxxxx>
- Date: 23 Nov 2006 03:17:21 -0800
I have a design question: How could I auto-select a new created
business object reprensentation in my GUI?
My application is divided into the business model and UI and I use the
command pattern. I can describe my problem with an IDE since it is the
same thing.
Imagine I create a new code file within a project. There may be a
dialog where the user has to specify the file name. When the user then
clicks on Ok the new file is created and it is added to the project
somehow. Now there is a project tree view in the GUI and within this
view a new node gets visible, representing the new file. Then the
question comes up: How can this node gets selected automatically?
How could this be done? Assuming that the execution of a command
CreateNewCodeFile has no return value I don't know how to get a
reference to the new business object. If I would get this reference
somehow, I could find the representing item, since (in my case) it also
keeps a reference to the business object.
I have already thought about something like a
RecentlyCreatedObjectManager class where I could get a reference to it
whenever a new business object is created by a command. Therefore the
command has to pass the reference to the manager. Good idea? I don't
think so...
Should I make a snapshot of the project tree before starting the
command and then compare the new tree with the old tree after command
executing to find the new node? I guess this also not best practice...
How have you done it or what could you recommend?
Cheers,
Robert
.
- Follow-Ups:
- Re: Auto selection
- From: H. S. Lahman
- Re: Auto selection
- From: Dmitry A. Kazakov
- Re: Auto selection
- From: Ed
- Re: Auto selection
- Prev by Date: Re: Howto model decoupled hierarchies?
- Next by Date: Re: Auto selection
- Previous by thread: How to describe array elements with UML2.0?
- Next by thread: Re: Auto selection
- Index(es):
Relevant Pages
|