This is a migrated thread and some comments may be shown as answers.

[Solved] trackChanges vs. beginUpdate

2 Answers 212 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
none123456
Top achievements
Rank 1
none123456 asked on 03 Jan 2008, 02:16 PM
In your documentation, you state:
Note that you should call the trackChanges method before you add/delete/update items and commitChanges method after you finished the client-side changes.

The standard approach for MS AJAX controls is to use methods named beginUpdate and endUpdate (rather than trackChanges and commitChanges). The MS documentation also states that these methods can be overridden to provide custom functionality.

I checked the client scripts
(Telerik.Web.UI.Common.Navigation.NavigationScripts.js)
and it appears that you are not deriving from Sys.Component or Sys.UI.Control. If you were to derive from one of these classes, you could just override beginUpdate/endUpdate to provide this standard functionality while following the MS AJAX conventions.

Please consider deriving from Sys.UI.Control for future releases and overriding beginUpdate/endUpdate instead of using the non-standard trackChanges/commitChanges.

Thank you for considering this matter.

David

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 03 Jan 2008, 02:46 PM
Hi,

Initially we considered overriding the beginUpdate/endUpdate methods of the Sys.UI.Component (in fact some early builds were implemented that way). However the AJAX documentation states that those methods are used for different purpose than tracking of client-side changes:

"Called by the create method to indicate that the process of setting properties of a component instance has begun."

We decided it was best not to change the semantics of beginUpdate/endUpdate and introduced our own methods for tracking and committing changes done on the client-side . I hope this is not a showstopper for you.

By the way RadComboBox inherits from Sys.UI.Control albeit it is not that obvious. Here is the inheritance chain:
Sys.UI.Control 
    Telerik.Web.UI.RadWebControl 
        Telerik.Web.UI.ControlItemContainer 
            Telerik.Web.UI.RadComboBox 

Regards,
Atanas Korchev,
the Telerik dev team

Instantly find answers to your questions at the new Telerik Support Center
0
none123456
Top achievements
Rank 1
answered on 03 Jan 2008, 04:41 PM
I'm very glad to hear that the controls do derive from Sys.UI.Control.

As far as beginUpdate goes, I can understand the concern about preserving the semantics. I believe some of the documentation is confusing at this point. As I understand it, beginUpdate and endUpdate are to be used to indicate when a number of properties are changing, to prevent things like re-drawing from reoccurring until all properties have been updated.

It appears that a few others share this understanding:
ComponentArt implements these methods this way.
ASPAlliance: Sys.Component supports "Performing batch processing of component property settings, which is more efficient in script size and processing time than handling all logic in individual property get and set accessors" (they must mean beginUpdate/endUpdate)
An ASP.NET blogger uses beginUpdate/endUpdate this way (code commented out, but still shows an example)

So, even though the documentation is not clear, I believe beginUpdate/endUpdate are designed to be used any time properties are set in bulk. If they were intended exclusively for the create process, I suppose they would have called them beginInitialize, beginCreate, or something similar.

Also, I beleve they are following the pattern used in WinForms, which has the semantics I described above.

I may be mistaken, but I think the documentation is just somewhat misleading, and beginUpdate/endUpdate are intended to be used in the exact scenario as trackChanges/commitChanges.

Thanks,

David
Tags
ComboBox
Asked by
none123456
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
none123456
Top achievements
Rank 1
Share this question
or