- GnrDomSrc_dojo_11.dataRemote(path, method, **kwargs)¶
Create a dataRemote and returns it. dataRemote is a synchronous dataRpc: it calls a (specified) dataRspc as its resolver. When dataRemote is brought to the client, it will be changed in a Javascript resolver that at the desired path perform the rpc (indicated with the remote attribute).
Parameters:
- path – the path where the dataRemote will save the result of the rpc
- method – the rpc name that has to be executed
- **kwargs – cacheTime=NUMBER: The cache stores the retrieved value and keeps it for a number of seconds equal to NUMBER
commons attributes:
For commons attributes (_init, _onStart, _timing) see controllers’ common attributes
Let’s see an example:
import datetime class GnrCustomWebPage(object): def main(self,root,**kwargs): fb = root.formbuilder(datapath='test1') pane.button('Show time', action='alert(time);', time='=.time') pane.dataRemote('.time', 'get_time', cacheTime=5) def rpc_get_time(self, **kwargs): return datetime.datetime.now()