Auto selection



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

.



Relevant Pages

  • Re: Auto selection
    ... business object reprensentation in my GUI? ... My application is divided into the business model and UI and I use the ... Now there is a project tree view in the GUI and within this ... Assuming that the execution of a command ...
    (comp.object)
  • How Can I Use The Com+ Server From Client
    ... on COM+ server) and the database ... I want that my client applications able to call the methods ... of business object across machine. ... When I open the "Add Reference" dialog box, ...
    (microsoft.public.dotnet.framework.interop)
  • Re: n-tier best practices
    ... If I create a business object how would I expose the dataset, ... "Andrew Faust" wrote: ... Then you could be passing a reference to ...
    (microsoft.public.dotnet.general)
  • Re: n-tier best practices
    ... You could have a function of your data class to retrieve the data ... > If I create a business object how would I expose the dataset, ... Then you could be passing a reference ...
    (microsoft.public.dotnet.general)
  • Re: n-tier best practices
    ... Take another instance if you will, 2 forms that share a business object. ... I can pass a datarow from form1 to form2, and on form2 bind the row to the ... Then you could be passing a reference to ...
    (microsoft.public.dotnet.general)