<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Nice! Looks good. Are you able to do this:<div><br></div><div><pre style="line-height: 17px; white-space: normal; color: rgb(42, 42, 42); background-color: rgb(255, 255, 255); ">callback: [:val1 :val2 | term1 := val1. term2 := val2. ] <span style="font-family: Tahoma; font-size: 10pt; ">value: (JSStream on: </span><span style="font-family: Tahoma; font-size: 10pt; ">'request.term') </span><span style="font-family: Tahoma; font-size: 10pt; ">value: (JSStream on: </span><span style="font-family: Tahoma; font-size: 10pt; ">'$(''#name'').val()');</span></pre></div><div><br></div><div>instead of this:</div><div><br></div><div><pre style="line-height: 17px; white-space: normal; color: rgb(42, 42, 42); background-color: rgb(255, 255, 255); ">callback: [:val1 :val2 | term1 := value ] <span style="font-family: Tahoma; font-size: 10pt; ">value: (JSStream on: </span><span style="font-family: Tahoma; font-size: 10pt; ">'request.term');</span></pre><pre style="line-height: 17px; white-space: normal; color: rgb(42, 42, 42); background-color: rgb(255, 255, 255); ">callback: [ :value | term2 := value ] value: (JSStream on: '$(''#name'').val()');</pre><br><div>Just a thought.</div><div>RS</div><div><br></div><div><div id="SkyDrivePlaceholder"></div>> Date: Tue, 28 Aug 2012 00:47:06 -0700<br>> From: lasmiste@gmail.com<br>> To: seaside@lists.squeakfoundation.org<br>> Subject: [Seaside] RE: JQuery ui autocomplete with multiple parameters<br>> <br>> Hi Robert,<br>> I solved it. I haven't data on client and I don't use the blur event, it's<br>> enough to read the "name" value via JQuery.<br>> <br>> <br>> On JQAutocomplete, I implemented a method mimicking<br>> JQAutocomplete>>sourceCallback: but with a two arguments block<br>> <br>> JQAutocomplete>>customSourceCallback: aTwoArgumentsBlock<br>>                 <br>>         | term1 term2 |<br>>         self source: ((self jQuery getJson<br>> <br>>                 callback: [ :value | term1 := value ] value: (JSStream on:<br>> 'request.term');<br>>                 callback: [ :value | term2 := value ] value: (JSStream on:<br>> '$(''#name'').val()');<br>>                 text: [ :stream | stream json: (aTwoArgumentsBlock value: term1<br>> value:term2).];<br>>                 onSuccess: 'response(arguments[0])'; <br>>                 dataType: 'jsonp') asFunction: #('request' 'response'))<br>> <br>> request.term is "address" field and you can see I easily grabbed the "name"<br>> value                <br>>                 <br>> <br>> <br>> Eventually, on my class, I linked the autocomplete to "address" field this<br>> way<br>> <br>> MyClass>>autocompleteOnAddress<br>> self addressField script: (html jQuery this autocomplete delay: 0;<br>> customSourceCallback: [ :address :name| self tryToFind: address and: name<br>> ]).<br>> <br>> <br>> <br>> In MyClass>>tryToFind:and: I made the search. That's it.<br>> <br>> <br>> <br>> Cheers<br>> Dave<br>> <br>> <br>> <br>> --<br>> View this message in context: http://forum.world.st/JQuery-ui-autocomplete-with-multiple-parameters-tp4645397p4645458.html<br>> Sent from the Seaside General mailing list archive at Nabble.com.<br>> _______________________________________________<br>> seaside mailing list<br>> seaside@lists.squeakfoundation.org<br>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br></div></div>                                            </div></body>
</html>