One of my tasks in our last block was to create a search box for a large value tree. For the implementation we (my team leader Doron and I) decided to use the AutoComplete extender from the Ajax Control Toolkit. While implementing, we ran into a couple of problems :
Problem :
I want the completion list to be right-to-left (for Hebrew input).
Solution :
- Set the CompletionListItemCssClass and CompletionListHighlightedItemCssClass.
- In both CSS classes insert the following attribute :
- DO NOT set this attribute in the CompletionListCssClass - it will cause the completion list to indent unexpectedly.
Problem :
When an error occurs in the completion list web service, there is no indication for it.
Solution :
Our solution was pretty simple : Warp the web service method content with try-catch and log the error. You can use other solutions (like AOP - with attribute on the method), but this is only a partial solution. In all solutions, the client has no idea that an error occurred. The only indication for it is that the completion list does not appear. I hope this will be fixed in the upcoming versions.
Problem :
I want each item to have a key assign to each value.
Solution :
This was not possible in the earlier versions of the toolkit. Today this is possible, be using the the OnClientItemSelected event. For the complete solution, check this out : http://blogs.msdn.com/phaniraj/archive/2007/06/19/how-to-use-a-key-value-pair-in-your-autocompleteextender.aspx
That's about it.
P.S.
Shani and his team made the usage of the web service for the AutoComplete more generic. I will be very grateful if he will add a couple of word about it (That means that you, Shani, are tagged - have fun)
In our project, we have two users in the database : applicative user and strong user. The strong user is the owner of all the objects (tables,layers,sequences, etc...) and the applicative user has only limited privileges for the object in the strong user.
When creating a new database table, you only have to run the grant SQL command on the table to give the access privileges to the app user. When creating a new layer, you just can't only give privileges to the table which represents the layer, because when creating a layer, the features are held in several tables (s,f,a,d tables). It's a bit difficult to use the grant command for each of these tables.
So, in order to grant privileges to a layer you can :
- Use ArcCatalog built in command : Right click on the layer in ArcCatalog -> Privileges -> Select the privileges and enter the user to which you want to grant the privileges -> OK.
- Use the 'Change Privileges' tool in the ArcCatalog toolbox.
- Use the sdelayer command : From the command line in your SDE server use the following command :
sdelayer -o {grant | revoke}
-l <table,spatial column name>
-U <user>
-A <SELECT,UPDATE,INSERT,DELETE>
[-i <service]
[-s <server_name]
[-D <database]
-u <DB_User_name>
[-p <DB_User_password>]
For example : suppose we have a layer names streets_g. In order to grant select privileges to our app user we will use this command :
sdelayer -o grant -l streets_g,shape -U appUser -A SELECT -u strongUser -p password.
All the above options are good. For installations I recommend to create a script which contains the sdelayer command for each of the layers in your database, or creating a model using the ArcCatalog toolbox does the same thing , but uses the toolbox 'Change Privileges' tool.