Talk:ResourceSuggestTextBox control
Thuan: Do you want it to actually be used? or this is just an example?
- => Chinh:It is for demonstration purpose only. It aims at demonstrating the use of ASP.NET AJAX for developing an AJAX-enabled control that can be put inside an Infragistic as an editor
- => Chinh: sure we can do the same without using web-service as a.Chương has proposed a solution for that. But, it requires some more effort
Thuan: Long time ago Phuc requested for such a feature but we rejected it because of performance issues. That's why I should ask you before writing comments :-P
Besides that:
- I think that jQuery.suggest is a great library which can be used to implement the intellisense feature for CGScript Editor :-P
- Can we implement the IScriptControl explicitly so that we can "partly hide" the GetScriptDescriptors and GetScriptReferences methods?
- ResourceSuggestTextBox is a custom control and it can be inherited. Therefore, using this.GetType().... for registering scripts is not recommended
Finally, I learned some new interesting things from this
- => Chinh:
- I think we can overcome the performance issue by limiting the number of returned records. In the implementation, the returned records are always less than 10 and the performance is quite good. If that is not enough, I think we can implement some special db-access (direcly talk to the db) that by pass some overhead of current DBAccess.
- Moreover, IMO, the control is a good candidate for replacing some features of adding to favorites. For example: whenever I have to fill in a User textbox, it should suggest all the possible users instead of only the ones in my favorites.
- => Thuan:
- We need one server call + 1 database access whenever we type in a character.
- It is only fast if we search for resources using StartWith or Exact.
- Querying the Resource table only means we cannot filter out deleted resources. Querying the Common_Resource view is too slow. Alternatively, we need to write N queries. Since the involved fields are common, we can execute them once.
- There is no access check!
- => Thuan:
- => Chinh:
- Here comes the interesting part of the suggest plugin. In fact, after each key pressed, only after a timeout period when the client actually do a web-request. So if user is typing too fast, only the last word will be sent back for requesting a search. This is a nice thinking, because to me, when user is searching for something, they start typing really fast and then stop at the term that they expect it to be searched for.
- Moreover, there is a cache for the suggest (not study enough about this cache) but it seems to be that the already searched term will not do the same search request to server. For example: when you press back-space for deleting some letters, then the previous word that were searched before will not cause a post back.
- => Thuan: wow, thank you for information about the client side cache.
- 1. I think that jQuery.suggest is a great library which can be used to implement the intellisense feature for CGScript Editor :-P
- => I have no idea
- 2. Can we implement the IScriptControl explicitly so that we can "partly hide" the GetScriptDescriptors and GetScriptReferences methods?
- => IMO, the interface is simple enough. But it is your choice of optimizing it
- 3. ResourceSuggestTextBox is a custom control and it can be inherited. Therefore, using this.GetType().... for registering scripts is not recommended
- => I’m not really sure about this
- => Thuan:
- FYI: http://blogs.ipona.com/james/archive/2006/10/03/6710.aspx
- An example: given that the NewControl inherits from ResourceSuggestTextBox but is it put in the CatGlobeWeb assembly, then:
- string assembly = this.GetType().Assembly.FullName;
- will be fullname of the CatGlobeWeb assembly.