cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Model Nodes

Former Member
0 Kudos

Hi Gurus,

Can anybody tell me , which is the best practise for mapping a structure to view through Component Controller .

1) Setting all the model node values to a Value node on controller level and Map to the view

2) Directly mapping the model node from controller to View .

Please tell me the advantage also ?

Thanks in advance .

Tony Isaac.

Accepted Solutions (0)

Answers (1)

Answers (1)

pravesh_verma
Active Contributor
0 Kudos

Hi Tony,

It purely depends upon your requirement. If your requirement is just to use the direct modeled attributes then you can directly do the mapping of the modeled component controller node with the view controller node. Access the attributes to get the values and use in your application.

However if you want to do some manipulations in the values of the attributes which are coming from the modeled attributes then you can go for value attributes OR if you want to use the modeled attribute in a way that after getting the values of modeled attribute you are modifying them to apply some otehr logic to it and then finally saving it back to backend then you can go for the copying modeled attributes to the value attributes.

I hope this helps. Please revert back in case you need further information regarding this.

Thanks and Regards,

Pravesh

Former Member
0 Kudos

Hi Pravesh,

Thanks for the quick reply .

From business requirement point of view , I agree with the reply . But on performance point of view , which is the best option ? Is there any restricting to map Model nodes to UI elements via Controller . In CE 7.1 EHP1 , when we map the model nodes to UI elements ( via Controller ), it is throwing and exception on runtime , showing that the datatypes from model nodes are not matching with the required datatypes of UI elements .

Is this mapping of model nodes on UI element violating MVC architecture ?

Regards ,

Tony Isaac.

pravesh_verma
Active Contributor
0 Kudos

Hi Tony,

No there is no such restrcition from WD framework. The exception which you might be having must be because you would have trying to map some modeled attributes which are not ofthe required data type which a UI element expects.

For example you can bind a boolean type of attribute with enable property of inputfield. However you cannot bind a hashmap type attribute with this property. So you need to be sure about the datatype which you are binding to the UI element. Make sure that the data type of teh attribute matached with the expected datatype of the UI element.

I hope this helps.

Thanks and Regards

Pravesh

Former Member
0 Kudos

Hi Pravesh,

Not exactly . When I am mapping a model node , that is supposed to return a string value to me , to a Table UI element , we are getting this exception . This seems to be a bug in CE 7.1 EHP1 . When we migrated our applications , that was running prefectly with model nodes mapped to UI elements in CE 7.1 , we started getting this issue and we were forced to create values nodes , collect the values and set to the UI element . Anyway I was just confused about , if direct mapping is not supported in EHP1 .

Thanks and Regards,

Tony Isaac.

pravesh_verma
Active Contributor
0 Kudos

Hi Tony,

This looks quite wiered. As far as I think EHP1 should not restrict you to bind any modeled node attribute with the UI element. This is very basic requirement and as I said earlier if the scenario demands then we always bind teh values directly to the UI element.

It makes no sence in first copying the values of the modeled node to the value node and then used the value nodes and finally take the values of the value node, copy them back to modeled node and finally save it. It will definitely hinder the performance. And in scenariois where we have lot of attributes in the structure then in all such cases the performance will be decresed drastically.

Therefore I dont feel that there will be any such restriction on this.

I hope this helps!

Thanks and Regards

Pravesh

Former Member
0 Kudos

Hi Pravesh,

Even we were surprised to find this . This may not be a restriction , then it would have shown some valid error message . This could be a bug in the new release . You can also try some scenario in EHP1 by mapping a model node to UI element and on runtime an exception will be thrown .

Thanks for the support Pravesh . Awarded you the points.

Tony Isaac.