|
Quick tip: trigger partial update from client side javascript
Julian Buss, March 18th, 2010 09:31:21
Tags: XPages
In one app I wanted to have a panel to be updated automatically in 30 minute intervals.
You can run a javascript function in intervals with "window.setInterval()". That's the easy part. But how to trigger a partial update to a panel/div from client javascript? As always with XPages, it's a piece of cake once you know it: you can use XSP.partialRefreshPost(id) with the runtime id of that control to trigger the partial update. You can even submit a piece of data with that function which you can get in the beforeRenderResponse event with something like: Client side: XSP.setSubmitValue(q); XSP.partialRefreshPost(panelid); Server side: var map = facesContext.getExternalContext().getRequestParameterMap(); var values = map.get('$$xspsubmitvalue'); Thanks to Rocky Oliver, he pointed me to that technique in his session at Entwicklercamp 2010. |
|

