7.2.4. dataRemote

Last page update: November 23, 2011

7.2.4.1. Definition

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
  • **kwargscacheTime=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

7.2.4.2. Examples

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()

Table Of Contents

Previous topic

7.2.3. dataFormula

Next topic

7.2.5. dataResource

This Page