Issue Details (XML | Word | Printable)

Key: XWIKI-1604
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Sergiu Dumitriu
Reporter: Evelina Petronela Vrabie
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XWiki Core

Generalized Ajax Suggest Feature

Created: 14/Aug/07 14:57   Updated: 20/Feb/08 00:58
Component/s: Templates & User Interface
Affects Version/s: 1.1 M3
Fix Version/s: 1.3 RC1

File Attachments: 1. GZip Archive suggest_img.tar.gz (0.6 kB)
2. Text File XWIKI-1604.patch (56 kB)

Environment: Ubuntu Fiesty
Issue Links:
Related
 

keywords: suggest, ajax, tags
Date of First Response: 14/Aug/07 15:09
Resolution Date: 20/Feb/08 00:58


 Description  « Hide
Generalized, user-friendly suggest feature for html input fields, using ajax.
It works for properties of type:
  • StringClass
  • DbListClass
  • StaticListClass
    Also works for tags (which are of type StaticListClass with Multiple Select and Relational Storage activated).

For DbListClass, the suggest can be used with the user's query (in the field "Hibernate Query", from the class). If the query retrieves two columns from the database (i.e "select distinct obj.name, prop.value from..."), then the first column is used as a "key" and placed in a hidden input, and the value is retrieved using obj.name. If the object does not exist yet, the user must create an object first and then use the suggest feature. If the query retrieves only one column (i.e "select prop.value from...") then the suggest feature does not need a hidden input to retrieve the key. If the user's query retrieves more than 2 columns, the suggest feature ignores the third, fourth...columns.



 All   Comments   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order


Vincent Massol added a comment - 29/Jan/08 17:50
Evelina says this is already done and committed.

We need to add a selenium test to prove it works and close it.


Sergiu Dumitriu added a comment - 19/Feb/08 14:03
The code was committed in rev. 5590 and 5591 by Thomas M.

Sergiu Dumitriu added a comment - 20/Feb/08 00:58
First implementation committed in rev. 7859

Patch applied in two steps. Most of the document where committed along with the new RMUI. A missing file was just committed with a few changes.

There are some problems with the current implementation:

  • It requires a document with programming rights. Right now it uses Main.WebHome, but it's not a good assumption that it will always have programming rights.
  • In a field with more than one value, the completion is triggered for the last word in the list, even if the user is typing in another word.
  • The JS code is not clean. It uses yet another codestyle, its own Ajax request implementation, event listeners...

This should be rewritten as an interface/skin/template extension, with a rewritten javascript core.