[Seaside] JQuery load question
Sven Van Caekenberghe
sven at stfx.eu
Mon May 19 13:13:43 UTC 2014
Johan,
I was hoping you would answer ;-)
Yes, that works perfectly !
Thanks a lot.
Sven
PS: Since you really know so much about this subject, it would help us all tremendously if you wrote some documentation beyond what is in the Seaside book - there is so much missing...
On 19 May 2014, at 15:06, Johan Brichau <johan at inceptive.be> wrote:
> Hi Sven,
>
> In theory, you can still use load and render the entire input field again.
> But you are right that setting the value of the input field is a better approach because replacing the entire field often messes with the keyboard focus.
>
> What you need is a script callback:
>
> (html jQuery ajax script: [:s | myModel doSomething. s << ((s jQuery id: #foo) value: myModel displayString)]
>
> I hope this is what you were looking for.
>
> Johan
>
> On 19 May 2014, at 14:59, Sven Van Caekenberghe <sven at stfx.eu> wrote:
>
>> Hi,
>>
>> I had some code that worked fine using JQuery's load functionality:
>>
>> html div id: #foo
>>
>> html button
>> bePush;
>> onClick: ((html jQuery id: #foo) load html: [ :h |
>> myModel doSomething.
>> h render: myModel displayString ]);
>> with: 'Do Something'
>>
>> Now, I switched #foo to a form input:
>>
>> html textInput id: #foo
>>
>> But then I should use #value: and not replace the HTML so I can't use load anymore.
>>
>> I don't seem to be able to write this but I am a real beginner here. Anyone ?
>>
>> Thx,
>>
>> Sven
>>
>> PS: the data coming back is just a string, not HTML.
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
More information about the seaside
mailing list