When using the CslaActionExtender there exists the following problem.
Take the following actions:
Show a form to edit for example a customer object.
Stop SQL Server to simulate an error.
Click on the OK button of the Customer form.
An error will be raised to say that no connection to SQL Server can be done.
Until now the behavior is as expected.
Start SQL Server again.
Try again to click on the OK button.
We get the following error:
System.InvalidCastException: The underlying data source does not cast to a CSLA BusinessBase object
This behavior is not as expected because the save should work now.
The problem is that the data source is empty. In case of an error you should call _bindingSourceTree.Bind(savableObject) no matter what PostSaveAction you have. Even in the case AndClose you should rebind the datasource so the user can try again to save the object.
Below follows the code of CslaActionExtender with an added line of code which solves the problem in my opinion.
Lhotka : can you have a look at this suggestion?
protected void OnClick(object sender, System.EventArgs e).....
try{
savableObject = savableObject.Save()
as Csla.Core.ISavable;...
}
catch (Exception ex)
{
_bindingSourceTree.Bind(savableObject);
//by adding this line of code it solves the problemOnErrorEncountered(new ErrorEncounteredEventArgs(props.CommandName, new ObjectSaveException(ex)));
raiseClicked = false;
}
I think so. I've added an entry in the bug tracker
Any date foreseen to fix this bug?
I know that Miguel has been doing a lot of travel over the past several months and has little or no time to work on CSLA. In these economic times paying work comes before volunteer efforts for most people.
same question in csla 3.8.4.
HI
There was a new release of CslaContrib that fixed all known bugs on CslaActionExtender.
Copyright (c) Marimer LLC