Search This Blog

Wednesday, December 6, 2017

Accessing real persistent objects through the SelectedObjects and CurrentObject properties of View and Action's event arguments when DataAccessMode = DataView or InstantFeedback

The View.CurrentObject and View.SelectedObjects properties return XafDataViewRecord objects instead of original business objects when the View operates in DataView mode (and XafInstantFeedbackRecord - in InstantFeedback mode). To get a real object, you can use the View.ObjectSpace.GetObject(obj) method.

I just wanted to remind you of this specificity and detail currently recommended solution strategies:

According to our current figures for support traffic in this regard (for one year of the InstantFeedback mode existence and more than two years of the DataView mode existence), this is not a big deal for our users - I located less than seven support requests in total. Probably, this is due to the fact that our learning materials already describe this or due to the fact that the DataView and InstantFeedback modes are used rarely, only when ListView contains a lot of records. Here I must also emphasize that this behavior exists in the first place because returning real objects by default may prevent you from getting all the benefits of these data access modes... So, we implemented the current design on purpose.

Should you have difficulties with these features and aforementioned solutions or can foresee better options, my team and I are happy to listen. For instance, one of the alternative solutions I saw in a couple places was the implementation of the auxiliary GetRealSelectedObjects/GetRealCurrentObject methods. Fortune

No comments:

Post a Comment