Silverlight Save button is not disabled after delete save

Silverlight Save button is not disabled after delete save

Old forum URL: forums.lhotka.net/forums/t/6359.aspx


zhengokusa posted on Friday, February 06, 2009

I have this code from Rolodex example  

                     <Button x:Name="saveBtn" Content="Save" Width="50" Margin="0,2"
                              csla:InvokeMethod.MethodName="Save"
                              csla:InvokeMethod.Resource="{StaticResource LicensorData}"
                              csla:InvokeMethod.TriggerEvent="Click"
                              IsEnabled="{Binding Path=CanSave, Mode=OneWay}" />
                    <Button x:Name="cancelBtn" Content="Cancel" Width="50" Margin="0,2"
                            csla:InvokeMethod.MethodName="Cancel"
                            csla:InvokeMethod.Resource="{StaticResource LicensorData}"
                            csla:InvokeMethod.TriggerEvent="Click"
                            IsEnabled="{Binding Path=CanCancel, Mode=OneWay}" />
                    <Button x:Name="deleteBtn" Content="Delete" Width="50" Margin="0,2"
                            csla:InvokeMethod.MethodName="Delete"
                            csla:InvokeMethod.Resource="{StaticResource LicensorData}"
                            csla:InvokeMethod.TriggerEvent="Click"
                            IsEnabled="{Binding Path=CanDelete, Mode=OneWay}" />

The problem is that after I clicked Delete button and then click Save, the CSLA dataprovider is not setting the Save button to disabled(the CanSave property dose not set to false after you click Delete and Save). So Then user is confused and they can click the Save button again, then the save button get disabled. However, what happen to the real data is that the recode first get deleted from the Database and then it gets added as a new recode.

This behavior is also in the Rolodex example. I may be a bug in the CLSA, Any ideas?

Thanks

 

 

 

 

 

ajj3085 replied on Friday, February 06, 2009

I get the same thing if my buttons are on a toolbar.  I haven't been able to find a solution.

rogercito replied on Friday, February 06, 2009

I'm also having the same problem, in a toolbar.

sergeyb replied on Friday, February 06, 2009

Here is a question, just to clarify.  Once the user deleted and saved the deletion, should the screen really display something other than the deleted record?  Maybe it should close to allow the user to select something else from a list of items?

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: rogercito [mailto:cslanet@lhotka.net]
Sent: Friday, February 06, 2009 3:11 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] Silverlight Save button is not disabled after delete save

 

I'm also having the same problem, in a toolbar.


zhengokusa replied on Friday, February 06, 2009

Well. I have a Close button for users to close out at any moment they want to.

You suggestion to me is more like a good work around. Anyway, for now if there is no way to solve this problme I may just have to make a work around for it as you suggested.

 

Thanks,

 

  

 

ajj3085 replied on Monday, February 09, 2009

Well, this happens too even if you're just saving the object and not deleting it.  I don't allow anything to be deleted.  I'd really like to know how to fix this because it's going to confuse my users.

zhengokusa replied on Monday, February 09, 2009

Well, if just for saving, It works great. I don't see any problem with it. You might need to revisit your code then.

I really hope they can fix the Deletion on the next release.

 

 

 

ajj3085 replied on Monday, February 09, 2009

Ahh... I guess I should point out that this is with Wpf, not Silverlight.  I thought you were getting the same thing, since both are Xaml.. but I guess not.  Smile [:)]

Copyright (c) Marimer LLC