FLUID-5272: The model relay throws error when the source or target component is a view or renderer component

Metadata

Source
FLUID-5272
Type
Bug
Priority
Major
Status
Closed
Resolution
Not A Bug
Assignee
Antranig Basman
Reporter
Cindy Li
Created
2014-02-11T11:26:29.233-0500
Updated
2014-02-11T16:28:15.834-0500
Versions
  1. 1.4
Fixed Versions
N/A
Component
  1. Framework

Description

Case 1: The target component is an independently defined view or renderer component.

1. Declare the target component independently as a view or renderer component:
fluid.defaults("fluid.tests.fluid5272sub", {
gradeNames: ["fluid.viewComponent", "fluid.standardRelayComponent", "autoInit"]
});

2. Define another component "fluid.tests.fluid9999" that has the model relay and transformation to the target:
fluid.defaults("fluid.tests.fluid5272Case1", {
gradeNames: ["fluid.standardRelayComponent", "autoInit"],
modelRelay: {
source: "{that}.model.celsius",
target: "{sub}.model.fahrenheit",
singleTransform: {
....
}
},
components: {
sub: {
type: "fluid.tests.fluid5272sub",
container: "#FLUID-5272"
}
}
});

3. Instantiating "fluid.tests.fluid5272Case1" throws "applier.preCommit is undefined" from DataBinding.js, line 678:

However, if the component type (fluid.viewComponent or fluid.rendererComponent) of the target component is directly specified in the same tree with the source component, no error occurs and the transformation works fine:

fluid.defaults("fluid.tests.fluid5272", {
gradeNames: ["fluid.standardRelayComponent", "autoInit"],
modelRelay: {
source: "{that}.model.celsius",
target: "{sub}.model.fahrenheit",
singleTransform: {
....
}
},
components: {
sub: {
type: "fluid.viewComponent",
container: "#FLUID-5272",
options: {
gradeNames: "fluid.standardRelayComponent"
}
}
}
});

Case 2: The source component is a view or renderer component.

1. The source component in the model relay is a view or renderer component:
fluid.defaults("fluid.tests.fluid5272Case2", {
gradeNames: ["fluid.viewComponent", "fluid.standardRelayComponent", "autoInit"],
modelRelay: {
source: "{that}.model.celsius",
target: "{sub}.model.fahrenheit",
singleTransform: {
....
}
},
components: {
sub: {
type: "fluid.standardRelayComponent"
}
}
});

2. Instantiating "fluid.tests.fluid5272Case2" throws "trans.transaction.reset" is not a function", from DataBinding.js, line 360

Comments

  • Cindy Li commented 2014-02-11T16:28:15.833-0500

    No need to fix since using new component types "fluid.viewRelayComponent" and "fluid.renderRelayComponent" fixes this issue.