Transcript
Page 1: Seaside Advanced Topics

SeasideAdvanced Topics

Page 2: Seaside Advanced Topics

Topics

• Advanced jQuery and Seaside <-> Javascript!

• New since 3.1:!

• RESTfulComponentFilter!

• SessionTrackingStrategy!

• GsDevKit!

• Your questions…

Page 3: Seaside Advanced Topics

Getting Started

• Download Pharo 3 from http://www.pharo.org!

• Download zipfile with pre-loaded image from:

http://bit.ly/1ySPvgs

Page 4: Seaside Advanced Topics

Webpage to Webapp

• STEP 1: ajaxify the TODO application!

WATODO>>renderAddNewTodoOn:

WATODOItem>>renderContentOn:

!

use jQuery AJAX form serialization

use jQuery DOM manipulation to update the client

Page 5: Seaside Advanced Topics

Webpage to Webapp

• STEP 2: Reduce requests to the server: combine ajax calls

Page 6: Seaside Advanced Topics

Combining AJAX CallbacksPrimary ajax callbacks:!

• #callback:!

• All response rendering callbacks!

#script:, #html:, #json:, #text:, #respond:

Secondary ajax callbacks:!

• #callback:value:!

• Convenience callbacks!

• #callback:json:, #callback:passengers, …!

• #serialize*:

Only 1 per request

Multiple per request

Page 7: Seaside Advanced Topics

+200 locations

1 - 2

mon

ths

Page 8: Seaside Advanced Topics

title

group

in-place editing info bubbles

group visualization

Page 9: Seaside Advanced Topics
Page 10: Seaside Advanced Topics

Webpage to Webapp

• STEP 3: Scale it by working with delegated events!

!

! Use passengers server-side for each separate element!

! Use top-level event handler doing a passenger lookup

Page 11: Seaside Advanced Topics

Working with JS libraries

• Javascript framework calling back to Seaside!

• Url!

• Function

Page 12: Seaside Advanced Topics

JS calling back into Seaside

• Wrap a jQuery ajax callback in a JS function!

• Easiest using existing jQuery wrapper code and JS generation!

• Not always possible if the library requires a url!

• Generate a url to an action callback!

• Requires a bit more understanding of how callbacks work!

• (Implement once, reuse all the time)


Top Related