locked
Web Sandbox: Register For Rules ($Rule.registerFor) RRS feed

  • Question

  • Hi there,

    This is my second attempt at trying to decypher the correct usage for this project. I first discovered this project about a year ago however I still find myself diappointed with the documentation and lack of source for the transformation service.

    So, I thought I'd try my luck and see if the forums can fill in some of the blanks.

    At the moment I'm trying to figure out the purpose and meanings for the following two calls taken from the simple self host sample.

    Could somone clarify the means of the callback arguments and the other parameters. So far it seems like the two params there refer to the gadget local document and javascript local global. The second param looks like the property name. So I guess i'm mainly looking at the last two parameters?

    //Register For Rules
    
    $Rule.registerFor($Policy.Gadget.__proxyDocument__, 'title', 'onafterset', function(c, o, m, a, blob) {
    
     if (blob.title)
    
       blob.title.innerText = a;
    
    });
    
    $Rule.registerFor($Policy.Gadget.__global__, 'defaultStatus', 'onafterset', function(c, o, m, a, blob) {
    
     if (blob.status)
    
       blob.status.innerText = a;
    
    });
    
    
    Note: I'd also like to point out i've found the ?debug=true feature for the sample pages, and it helps a bit.
    Monday, March 14, 2011 3:12 AM

All replies

  • Callback Function Parameters

    Blob: object passed to $sandbox call to create new instance

    a: value assigned to property 


    Daniel
    Friday, March 18, 2011 3:19 AM
  • $Rule.registerFor(p1, p2, p3, p4)

    This function registers a callback for a property

    I'm not sure if the actual rule must be defined proior.

    Param1: Rule object

    Param2: Property name

    Param3: When to call the callback (ToDo: find other possible values)

    Param4: Callback


    Daniel
    Friday, March 18, 2011 3:27 AM