Synch ListView Control


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
This is a sample of how to use a list view to navigate through the records of a ListView and keep the ListView in synch with the BO. A SF ListView was subclassed to add the synching functionality. See the project for info on how it was done. The project uses the StrataFrameSample db.



Features:

- Fairly easy to setup.

- Handles adding, updating and deleting within the BO

- Selecting an item in the list navigates to that item in the BO.

- Navigation of the BO automatically updates selected item in the list.

- Filling the data table automatically updates the list and synchs it



Usage:

- Drop a BO on the form

- Drop this control on the form

- Setup the columns for the listview (normal SF procedure)

- Setup the Population list settings. The method must be CopyDataFrom using the business layer overload.

- Set the BO of the synch list control



These are the basics. The last step depends on how you will load the BO. In the sample, the BO is simply loaded when the form is loaded. In that case, have the list load when the form is loaded also and be sure the initialization priority of the list to be larger than the priority of the form (the BO needs to be loaded first).



If you load the BO manually, then the list should be loaded manually also. Whenever you load the BO, simply call the UpdateAndSynch() method of the list after loading.



I typically will call the SelectFirstListItem() method after the load in order to make sure that the first item in the list is selected. This could probably be built in, but isn't at this point.



As always, comments/suggestions/improvements are welcome and appreciated!



Greg
Attachments
SynchListExample.zip (388 views, 749.00 KB)
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Greg McGuffey (03/17/2008)
As always, comments/suggestions/improvements are welcome and appreciated!

Greg

Greg, this is great!, just now I had the time to test this and was able to make it run without error the very first time, very simple and easier to use and it works as advertised.

Thanks a lot for sharing this with us.

P.S.

Trent, this will be a great enhancement to the framework, please try it.

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Glad it helped and worked! BigGrin



If you think of or code any enhancements, please share BigGrin
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
ListView now supports UI data interaction including related business objects, child form dialog, and related command or toolstrip buttons.

The ListView has been dramatically expanded to have native logic for tasks that are common recoded.  There are now many new properties (detailed below) and events that allow a more dynamic child display interaction with much less code.  By simply setting the UI interaction properties of the ListView, the ListView will dynamically manage the toolstrip buttons (or any other type of control) for the Add, Edit, and Delete as well as any security keys that may also be associated with those objects.  Additionally, a ChildFormDialog can be attached to the ListView which will then by dynamically shown to the end-user on an Add or Edit dynamically with no additional code.  Finally, the ListView will now allow the instance of the business object of which it represents to be attached and the current index (or row position) of the business object to be dynamically updated.

New Properties: 

AddObject
AddObjectSecurityKey
EditObject
EditObjectSecurityKey
DeleteObject
DeleteObjectSecurityKey
DeleteMessageKey
AutoNavigateToSelectedRecord
HandleAddAction
HandleDeleteAction
HandleEditAction

New Events: 

ChildFormResults

I will post the updated assemblies and a sample of how to use this new logic later this week.

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
GreatExclamation Mark

Thanks a lot.Tongue

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Cool Trent! I look forward to checking it out!
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Greg McGuffey (03/18/2008)
Cool Trent! I look forward to checking it out!

Hi Greg,

I made a change to the SynchListView class to handle the SaveUndo, so when the Undo is executed the listview will be re-synch.

All the code I added is commented with the following string:

' Edhy Rijo 03/19/2007:



Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Thanks Edhy! I'll check it out BigGrin
Michael Reese
Michael Reese
StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)StrataFrame User (403 reputation)
Group: StrataFrame Users
Posts: 235, Visits: 1.6K
Sounds Great!

So does that mean we do not have the code the listview anymore? Will already coded listviews have the code removed? Is it still coming soon?

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
So does that mean we do not have the code the listview anymore?

Pretty much...I have been using it for a week now and it has been working well.  I will post a sample and assemby pretty soon so you all can have it as well.

Will already coded listviews have the code removed?

No, they will work as they did before.  If you want to use the new logic you can, but all existing code will still work just fine.

Is it still coming soon?

Yup...very Wink

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search