Hi there,
I have a Business Object which maps onto a table row in a database.
Within each object I have an enumerated type that represents all the fields
within it, and this is used to create a constant mapping store, that maps
fields, types, sizes etc. It also has the default information to drive
whether or not that field will appear in the generic Search grid I have,
plus its width and position. This constant map is loaded at startup for
each Business Object into dynamic storage, so on Search of an object I
collect that from the Business Object I am searching on.
On the Search grid you can adjust these fields, make them visible or not,
resize, position etc. The BusinessObjects are loaded into
BusinessObjectLists and for display purposes only each row is loaded into a
string list and the grids are mapped onto the columns.
By changing my model to do this generically I have come across some
limitations, the first is probably fairly simple to solve, and that it some
fields are currency, or floats by origin albeit as I said stored as a string
for display, but I want these fields to be Right Justified in the grid,
which is easy if I know that is what is required for a specific field, but I
am struggling to work out how or where to store some indiciator against that
field to force this kind of treatment for display.
The second problem is similar, but slightly more complex as all my time
fields are stored as seconds in the database, i.e. seconds from midnight,
and before I was mapping directly onto the data type of that field within
the Business Object, so I was able to call a function to convert it for
display, but now it is just in a string list based on the enumerated type of
that biz obj, so I need to be able to map that function against those fields
in my Dynamic storage of my mapping information, so that when it sees from
the dynamic mapping info that this field needs to have x done to it.
Sorry this took a little explaning, but I felt the background was important
to see a slightly bigger picture, and therefore a possible solution, I
suspect the first problem will solve the second.
Many thanks in advance
Colin B