StrataFrame Forum

Combobox issue...

http://forum.strataframe.net/Topic12697.aspx

By Edhy Rijo - 11/14/2007

Hi,

I have a MaintenanceForm which uses a Browse Dialog, I noticed that when opening the form (with no data) all comboboxes in the form will show the first record of its own data even thought there is no record selected in the primary business object (POBO).

What am I missing here?  I believe comboboxes should be blank like all other fields and only show its data when a record is selected in the POBO.

Please see picture attached for better understanding of this issued.

Thanks!

By Greg McGuffey - 11/14/2007

Use the TopMostItem to add an item to the combo for blank items. Usually I use this in combination with the return alternate when null feature for the field in my BO. I.e. I would setup my CustomerID field in the BO to return 0 on null (and probably set NULL if the BO's value is zero), then I'd add a TopMostItem to the combo, with text something like "(none)" and a value of zero.



Hope that helps!
By Edhy Rijo - 11/14/2007

Hi Greg,

Thanks for the suggestion, it is a nice idea but a bit tedious if I am using several comboboxes.  Also this introduce an issue in which I would have to code validation rules for all comboboxes which must have a valid value and then the not empty validation rule will not fail because 0 or -1 is a valid value.

Is there any other way the framework can take care of this issue without the need to do a lot of coding for each combobox?

Enhancement Request:

I do like the Business Object Mapper, but I feel it is under used.  Even though the BOM does a lot of work creating the BOs, it should do more automated stuff for things we have to do over an over in forms and projects, things like Default Field Values, Input Mask, Captions for the Labels, Custom Field Properties, etc. are things that may fit in the BOM.

By StrataFrame Team - 11/19/2007

Yes, because of the way ComboBoxes work, if you have one set as a DropDownList, the value must be present in the list, so it requires a TopMostItem to have a "blank" value and not just select the first value in the list.

things like Default Field Values, Input Mask, Captions for the Labels, Custom Field Properties, etc. are things that may fit in the BOM.

Yes, most of those will be addressed in the next major version of StrataFrame (the one that will support LINQ among other things).