NVL Design Advice

NVL Design Advice

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


DJC posted on Saturday, January 12, 2008

Hi All

I have a UI screens that contain a combo box who's datasource is a Namevalue list. When The UI screen is used to add records, the Namevalue list should only contain the students who are active. Now if i historically look at a record that references a now inactive student, i will have an issue because the business object will reference an ID of the student now not contained within the NamevalueList.

I am sure this situation has been encountered many times before and am looking for ideas as to how others may have approached this situation

RockfordLhotka replied on Saturday, January 12, 2008

See my post in this thread
http://forums.lhotka.net/forums/thread/20326.aspx

If the contents of an NVL are context-sensitive, then they should typically come from a property on another object so that object can properly load the NVL.

DJC replied on Saturday, January 12, 2008

Ok Thanks for that .  I guess my confusion  with this situation is that the contents  of the NVL seems to be dependent on wther the UI is in an edit mode or Add mode.  As a result it seems that the contents of the NVL will be the list of Active Students  plus the One loaded as part of the Business object (should that Student have been set to Inactive over the course of time).  This is a bit like loading a none option as an extra item into the combo box.

JoeFallon1 replied on Sunday, January 13, 2008

I run into that situation all the time in my NVLs.

But I built it into a user control and have not thought about it for years now.

You are basically correct, when adding a new row the NVL only has Active records in it.

When Editing an existing record it is the list of Active records plus the related record if it isinactive. I also have rules that allow the record to be saved with the "invalid" record in the NVL as long as it is the same as the original value when the form opened. In other words they can change the record without having to "update" the inactive selection in the nVL as long as they do not change it to some other invalid selection. If they voluntarily change it to a valid selection then that is fine.

Joe

Copyright (c) Marimer LLC