Work with BO in ReadOnly Mode ?


Author
Message
Rainer Kempf, RK
Rainer Kempf, RK
StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)
Group: StrataFrame Users
Posts: 55, Visits: 1.4K
Hello



I use some BO's only for displaying Data. These BO's are Bound to a DevExpress.Grid



Grid is in readonly mode.



When i navigate through the Grid and then Close form BO ask for save data.



Is there as way to tell BO it should ignore all. i mean something like a READ_Only flag.



thanks



Rainer
Philipp Guntermann
Philipp Guntermann
StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)StrataFrame User (233 reputation)
Group: Forum Members
Posts: 141, Visits: 263
Hi Rainer,

try setting the "AutoShowSaveChangesMessage"-Property on the Form to false.

this should prevent it to show the save changes confirmation message.

Rainer Kempf, RK
Rainer Kempf, RK
StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)
Group: StrataFrame Users
Posts: 55, Visits: 1.4K
Hi Phillip



Works , Super



Thank you



Rainer
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Reiner,

Since you want to treat the data in the BO as ReadOnly, I believe that setting the property "AutoShowSaveChangesMessage" will simply not show the save confirmation message, but internally it may be saving the data back, I am not sure this is what is happening, but if that is the case you may end up with unwanted saved data.

Check out the BO properties SetDirtyOnEdit and ManageUIReadOnlyState and play with them, since I believe that setting these property to False may prevent the BO to become Dirty and will not trigger any saving.

Edhy Rijo

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
There is also an option in BO mapper to set a column 'read only' though I don't know its implications. Anybody?

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I believe the BO mapper just serializes the field as a readonly property (no setter). The field would be bindable, so you could bind it to a control in order to view the data, but if you attempted to set the value, you'd get an error.
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)Advanced StrataFrame User (966 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
So SF will exclude the field prop from the Update statement on a save ?



Anybody have a real-world example of why you would use that and is it effectively the same as adding the field to the ExcludefromUpdate collection in the BO?



Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
One likely reason would be that the field will be filled by a trigger and never any other way. You could also use this with a calculated field in SQL.



The reason to use this instead of the Exclude properties would be to strongly enforce the readonly nature. You don't have to remember to set the exclude properties, nobody can override those values, etc.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search