Issue 221 in glassdb: JQAutocomplete broken on GemStone

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 221 in glassdb: JQAutocomplete broken on GemStone

glassdb
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium GLASS-Server Version-GLASS0.231

New issue 221 by [hidden email]: JQAutocomplete broken on GemStone
http://code.google.com/p/glassdb/issues/detail?id=221

Assignments to temporaries (for inter-callback communication) do not work  
in GS-2.4.x
This is done in the JQAutocomplete>>search:labels:callback: method, which  
does not work in GS

A workaround for the method is included below:


search: aSearchBlock labels: aLabelsBlock callback: aCallbackBlock
        "A one argument block aSearchBlock that will be evaluated with the term  
the user currently typed. The block is expected to answer a collection of  
objects. aLabelsBlock should answer a string label to be displayed for each  
object. aCallbackBlock is evaluated with the selected object and an ajax  
script to be performed."
       
        | term mapping |
        mapping := IdentityDictionary new.
        term := Array new: 1. "In GS, we cannot assign to a temp, so we create a  
valueholder"
        self source: ((self jQuery getJson
                callback: [ :value | term at: 1 put: value ]
                value: (JSStream on: 'request.term');
                text: [ :stream |
                        stream json: ((aSearchBlock value: (term at: 1)) asArray collect:  
[ :object |
                                GRSmallDictionary new
                                        at: 'label' put: (aLabelsBlock value: object);
                                        at: 'index' put: (mapping at: object ifAbsentPut: [ mapping size + 1  
]);
                                        yourself ]) ];
                onComplete: 'response(arguments[0])';
                dataType: 'jsonp') asFunction: #('request' 'response')).
        self onSelect: ((self jQuery ajax
                callback: [ :value | term at: 1 put: value greaseInteger ]
                value: (JSStream on: 'ui.item.index');
                script: [ :script |
                        mapping keysAndValuesDo: [ :object :value |
                                value = (term at: 1)
                                        ifTrue: [ aCallbackBlock value: object value: script ] ] ])
                asFunction: #('event' 'ui'))

Reply | Threaded
Open this post in threaded view
|

Re: Issue 221 in glassdb: JQAutocomplete broken on GemStone

glassdb
Updates:
        Status: Accepted
        Owner: [hidden email]
        Labels: -Version-GLASS0.231 Version-1.0-beta.8 Milestone-1.0-beta.8.6

Comment #1 on issue 221 by [hidden email]: JQAutocomplete broken on  
GemStone
http://code.google.com/p/glassdb/issues/detail?id=221

(No comment was entered for this change.)

Reply | Threaded
Open this post in threaded view
|

Re: Issue 221 in glassdb: JQAutocomplete broken on GemStone

glassdb
Updates:
        Labels: -GLASS-Server GLASS-Seaside30

Comment #2 on issue 221 by [hidden email]: JQAutocomplete broken on  
GemStone
http://code.google.com/p/glassdb/issues/detail?id=221

(No comment was entered for this change.)

Reply | Threaded
Open this post in threaded view
|

Re: Issue 221 in glassdb: JQAutocomplete broken on GemStone

glassdb
Updates:
        Status: Fixed
        Labels: Fixed-1.0-beta.8.6

Comment #3 on issue 221 by [hidden email]: JQAutocomplete broken on  
GemStone
http://code.google.com/p/glassdb/issues/detail?id=221

Name: JQuery-UI.gemstone-DaleHenrichs.73
Author: DaleHenrichs
Time: 02/17/2011, 12:15:12
UUID: 7db6ae12-409f-4dbd-af6e-05448213521e
Ancestors: JQuery-UI.gemstone-DaleHenrichs.72

available in Seaside 3.0.4