on 10-24-2007 2:40 PM
Dear SDN Community,
When I map a context between the view and the component controller, 2 options exists, one is create a context node structure in the component controller and drag the entire node from left to right(controller to view) and the second option is you create the same node structure in both the view and controller and map it. What is the difference between these two options ? Also if I want to use calculated function for mapping how i can do it ?
Thanks!
Surya
Hi,
There is not any difference. The difference lies only on the way of mapping.
(1) If you map from controller to view, then your controller's context will always expect the modification from view's context and get updated by view's context modification.
(2) And if you map from view to component then vice versa.
And with calculated function of an attribute, you can do calculation and modify other attributes and context in the getter's of attribute.
Regards,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
When I map a context between the view and the component controller, 2 options exists, one is create a context node structure in the component controller and drag the entire node from left to right(controller to view) and the second option is you create the same node structure in both the view and controller and map it. What is the difference between these two options ?
No difference.
Also if I want to use calculated function for mapping how i can do it ?
You cant have a mapped attribute calculated at the mapped end.
Controller----
> View
Attr1 NonCalculated Attr1 Mapped to Controller [Here you cant make it calculated, if you try this will lose its mapping]
Attr1 Calculated Attr1 Mapped to Controller[ Will work as usual]
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is no difference in the result after mapping by dragging from left to right or right to left.
If you first define the node in the controller and then drag from right to left, you don't have do redundant typing
It's also possible to copy paste nodes or attributes between different context-views.
All nodes have a source. You can't have more than one source. Therefor you can't have a calculated field in the view AND the controller AND they are mapped...
Use calculated fields a lot. This way your code is isolated in its context and your code will be easier to maintain. (if the alternative is to have some secret method updating your custom fields)
Depending on what your field is intended for you should have it as a calculated field either in the view or in the controller. Think MVC.
(spellcheck)
Message was edited by:
Mikael Löwgren
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.