Hi,
I think I found a bug using the CslaActionExtender. I am using the latest version of 3.6.1. Basically I want the Save button to be disabled when the object is clean. By default DisableWhenClean is true. If I change it to false, then it will write the following line in designer code:
this.cslaActionExtender1.SetDisableWhenClean(this.btnSave, false);
In my scenerio I want this to be true. When I change it back to true this line is removed because it is the default value. However, in the CslaActionExtender class, the true value is lost and DisableWhenClean is always false.
ChangeEnabled(ctl, !pair.Value.DisableWhenClean);
The fix I found is to manually put the line in the designer to force DisableWhenClean to true.
this.cslaActionExtender1.SetDisableWhenClean(this.btnSave, true);
Now it correctly disables the button when the object is clean and enables it when the object is dirty.
Has anyone else run into this?
Thanks,
Mike
You are saying that it works fine normally.
But if you set, in VS, the value to false, then back to true this changes the behavior?
Rocky,
No, I believe it doesn't work anytime when it is true. When I first add the extender and it is set to true it doesn't write the line either since it is default. So it didn't when then. Somewhere the default value is lost. I used the ActionClassExtender sample to figure it out.
Thanks,
Mike
Thanks. It sounds like the default simply isn’t set in
code. probably the field that contains this value simply isn’t initialized
to true in the code.
I’ll add this to the bug list.
Rocky
From: CodeSmartNotHard
[mailto:cslanet@lhotka.net]
Sent: Sunday, February 15, 2009 10:51 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] Bug in CslaActionExtender?
Rocky,
No, I believe it doesn't work anytime when it is true. When I
first add the extender and it is set to true it doesn't write the line either
since it is default. So it didn't when then. Somewhere the default
value is lost. I used the ActionClassExtender sample to figure it
out.
Thanks,
Mike
Copyright (c) Marimer LLC