Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Include Page
sneak peek warning
sneak peek warning
{div:class=floatRight} {panel:title= On This Page| borderStyle=solid| borderColor=#ccc| bgColor=#fff} {toc:minLevel=2|maxLevel=5} {panel} {div}
Wiki Markup
Div
classfloatRight
Panel
borderColor#ccc
bgColor#fff
titleOn This Page
borderStylesolid
Table of Contents
minLevel2
maxLevel5

Invokers: Dependency Resolution At Invocation

...

Examples of Arguments to Invokers

{span:class=} |{code:javascript}
Wiki Markup
Span
classborderless-table
Code Block
javascript
javascript

invokers: {
    myFunc: {
        funcName: "nspace.myFuncImpl",
        args: ["@0", {parent}.field, "@1"]
    }  
}
{code}|

In

this

example,

if

{

Code Block
:
javascript
|
borderStyle
=
none
}
javascript

that.field = "CATT";
{code}

and

the

invoker

is

called

with

{

Code Block
:
javascript
|
borderStyle
=
none
}
javascript

that.myFunc("foo", "bar");
{code}

then

the

invoker

will

call

the

implementation

function

with

{

Code Block
:
javascript
|
borderStyle
=
none
}
javascript

nspace.myFuncImpl("foo, "CATT", "bar);
{code}|

{span}

Examples

{span:class=} |{code:javascript}
Wiki Markup
Span
classborderless-table
Code Block
javascript
javascript

fluid.defaults("cspace.autocomplete.popup", {
    invokers: {
        treeBuilder: {
            funcName: "cspace.autocomplete.modelToTree",
            args: ["{popup}.model", "{popup}.events"]
        }  
    },
    ...
};
{code}|

In

this

example,

the

popup

component's

{{

that

}}

object

will

have

a

function

called

{{

treeBuilder

}}

,

i.e.

{{

that.treeBuilder()

}}

.

This

function,

when

called,

will

evaluate

the

current

{{

{popup

}}

and

{{

events

}}

properties

of

the

popup

component

and

pass

them

to

the

function

{{

cspace.autocomplete.modelToTree()

}}

.

| {

}{span:class=} |{code:javascript}
Span
Wiki Markup
classborderless-table
Code Block
javascript
javascript

fluid.defaults("test.testComponent", {
    template: "Every {0} has {1} {2}(s)",
    invokers: {
        render: {
            funcName: "fluid.formatMessage",
            args:["{testComponent}.options.template", "@0"] 
        }
    },
    ...
{code}|

In

this

example,

the

component's

{{

that

}}

object

will

have

a

function

called

{{

render

}}

,

i.e.

{{

that.render()

}}

.

This

function,

when

called,

will

evaluate

the

current

{{

{options.template

}}

property

of

the

test

component

and

pass

it

and

the

first

parameter

to

{{

that.render()

}}

to

the

function

{{[|fluid

.

formatMessage]}}. | {span}

The following two methods of declaring an invoker are equivalent:

...