| | | StrataFrame VIP
       
Group: StrataFrame Users Last Login: Yesterday @ 6:42:41 PM Posts: 1,058, Visits: 2,581 |
| 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
|
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Yesterday @ 9:46:15 PM Posts: 288, Visits: 1,135 |
| Greg McGuffey (03/17/2008) As always, comments/suggestions/improvements are welcome and appreciated!
GregGreg, 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 RijoProgytech (Computer Consultants) |
| | | | StrataFrame VIP
       
Group: StrataFrame Users Last Login: Yesterday @ 6:42:41 PM Posts: 1,058, Visits: 2,581 |
| Glad it helped and worked! 
If you think of or code any enhancements, please share |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 3:24:00 PM Posts: 3,733, Visits: 3,926 |
| | 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. |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Yesterday @ 9:46:15 PM Posts: 288, Visits: 1,135 |
| Great Thanks a lot.
Edhy RijoProgytech (Computer Consultants) |
| | | | StrataFrame VIP
       
Group: StrataFrame Users Last Login: Yesterday @ 6:42:41 PM Posts: 1,058, Visits: 2,581 |
| | Cool Trent! I look forward to checking it out! |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Yesterday @ 9:46:15 PM Posts: 288, Visits: 1,135 |
| 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 RijoProgytech (Computer Consultants)
|
| | | | | |
|