Summary of Event Response
The behaviour of web.EventFunc is controlled by it's return type web.EventResponse
- PageTitleset 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 page
- Bodyis the set to- web.PageResponse's body when- Reload = trueis set, Or set to the partial html component when using- ReloadPortalstogether with- web.Portal().EventFunc("related")
- Reloadis to reload the- web.PageFunc, before reload, you can set- ctx.Flashobject to let the event func render the page differently (flash message, validation errors, etc)
- Locationis to change the browser url with push state, and AJAX load the page of that url
- RedirectURLis to change the browser url without AJAX, reload the whole page html includes it's head script, css assets
- ReloadPortalsis for reload the portal that uses- web.Portal().EventFunc("related")
- UpdatePortalsupdate the portal specified by the name- web.Portal().Name("hello"),- pu.AfterLoadedset the javascript function that execute after the portal is updated, for example:- VarsScript: "setTimeout(function(){ comp.vars.drawer2 = true }, 100)"
- Datais for any AJAX call that want pure JSON, you can set- er.Data = myobjto any object that will marshals to JSON, and on the client side use javascript to utilize them