Summary of Event Response
The behaviour of web.EventFunc
is controlled by it's return type web.EventResponse
PageTitle
set the html head title, It not only set when render html page directly which is request the url directly from the browser. Also use javascript to set the page title when you do push state AJAX request to load the pageBody
is the set toweb.PageResponse
's body whenReload = true
is set, Or set to the partial html component when usingReloadPortals
together withweb.Portal().EventFunc("related")
Reload
is to reload theweb.PageFunc
, before reload, you can setctx.Flash
object to let the event func render the page differently (flash message, validation errors, etc)Location
is to change the browser url with push state, and AJAX load the page of that urlRedirectURL
is to change the browser url without AJAX, reload the whole page html includes it's head script, css assetsReloadPortals
is for reload the portal that usesweb.Portal().EventFunc("related")
UpdatePortals
update the portal specified by the nameweb.Portal().Name("hello")
,pu.AfterLoaded
set the javascript function that execute after the portal is updated, for example:VarsScript: "setTimeout(function(){ comp.vars.drawer2 = true }, 100)"
Data
is for any AJAX call that want pure JSON, you can seter.Data = myobj
to any object that will marshals to JSON, and on the client side use javascript to utilize them