Adding to NVL etc

Adding to NVL etc

Old forum URL: forums.lhotka.net/forums/t/3660.aspx


griff posted on Sunday, October 07, 2007

Hi
quite new to CSLA...I need some advice/suggestions for best practice.

Scenario an Agency has SubAgencies linked...... thus we have a
AgencySubAgencyList table (AgencyID, SubAgencyID)

Windows app form with two list boxes - lstAvailableAgencies and
lstAgenciesSelected, two buttons Add, Remove.
Typical scenario is to click Add to move an item from
lstAvailableAgencies into the table/listbox lstAgenciesSelected (and
remove button to de-select).

My thoughts are to have two NVL csal objects  as datasource for the
list boxes
The Add button then calls a stored procedure to insert into
AgencySubAgencyList table then refresh the two lists (clear cache and
do database call -to show new item in 'Selected'  and remove item from
available list (not selected)

Or is there a better way? maybe using EditableRootCollection and
ChildObjects to Add/remove from collection etc

Please you thoughts, thanks.

Richard

RockfordLhotka replied on Monday, October 08, 2007

There is an OO concept that's important here - object stereotypes. These are a set of common behaviors and a broad purpose for an object.

NVLB supports a specific stereotype, which is intended to make it easy to populate read-only list/combobox controls.

BusinessListBase/BusinessBase support editable object scenarios. You want the editable root list stereotype, because that supports editing of lists and/or the objects contained in the lists.

griff replied on Tuesday, October 09, 2007

Thanks, will look into, Richard

Copyright (c) Marimer LLC