[Seaside] JQuery load question
johan at inceptive.be
Mon May 19 13:06:59 UTC 2014
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.
On 19 May 2014, at 14:59, Sven Van Caekenberghe <sven at stfx.eu> wrote:
> I had some code that worked fine using JQuery's load functionality:
> html div id: #foo
> html button
> 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 ?
> PS: the data coming back is just a string, not HTML.
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside