StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
BOM-generated bug with FieldChangingEvents and Nullable Fields
BOM-generated bug with FieldChangingEvents and Nullable Fields
Post Reply
Like
0
BOM-generated bug with FieldChangingEvents and Nullable Fields
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Kirk M Sherhart
Kirk M Sherhart
posted 15 Years Ago
ANSWER
Topic Details
Share Topic
Group: Forum Members
Posts: 41,
Visits: 259
If a field has a Null Type of "Return and Set Alternate on Null..." and the Property Changing Events (either single or multiple) are generated, then the following code is generated.
public System.String FIELD1
{
get
{
object loValue;
loValue = this.CurrentRow["FIELD1"];
if (loValue == DBNull.Value)
{
return "";
}
else
{
return (System.String)loValue;
}
}
set
{
MyBOFieldChangingEventArgs e = new MyBOFieldChangingEventArgs(MyBOFieldNames.FIELD1, value);
this.OnFieldPropertyChanging(this, e);
if (value != "") <===
*** Note: e is not used!!!! ***
{
this.CurrentRow["FIELD1"] = value;
}
else
{
this.CurrentRow["FIELD1"] = DBNull.Value;
}
}
}
The e.FieldValue is not used after returning from the event!!!! The e.FieldValue should be cast/set to value (as it is if the field is not nullable.)
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
BOM-generated bug with FieldChangingEvents and Nullable Fields
Kirk M Sherhart
-
15 Years Ago
Do you get a different result if you return and test for string.empty...
Charles R Hankey
-
15 Years Ago
The result is the same if the null-replacement value is "" or...
Kirk M Sherhart
-
15 Years Ago
What are you using for an alternate return value in the bo mapper?
Charles R Hankey
-
15 Years Ago
Just tried to see if the problem was fixed under 1.7. No change. Too...
Kirk M Sherhart
-
14 Years Ago
Apparently this missed the list. Changing it right now so it is sure...
Trent L. Taylor
-
14 Years Ago
Fixed. It will be in the next update. If you want this assembly, let...
Trent L. Taylor
-
14 Years Ago
Thank you! I can wait for the next release.
Kirk M Sherhart
-
14 Years Ago
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search