With uComponent 3.1 (and umbraco 4.8.1), we used BaseElement from DynamicXml to parse the uComponents (MNTP, "multiple text string" etc...)
So it was something like :
foreach (XElement item in Model.MyMNTP.BaseElement.Elements("nodeId")) {...}
same for multiple text string.
After upgrading to uComponent 4, it seems that the mapping/Razor bidding has changed.
The MultiNodeTree Picker is a now a list of DynamicNode and the multiple text string is a List of String.
It makes sence and it's easier to use but it broked all our code :)
I'm OK rewritting the code (it'll be cleaner) but I'm worried about uComponent 5
So my question is : will it be the same mapping in uCompenent 5 ?
I trying to anticipate to not have to rewrite the code again => if the mapping/Razor bidding will change from uCompoenent 4 to 5, I guess I could get the property as a string and create a DynamicXml object out of it (so I don't get affected by changes on the mapping)
I hear your frustrations. We enabled the Razor model binding by default, as it was a much requested feature for uComponents. We have added an option to disable the model binding, by adding this to your Web.config AppSettings:
Interesting! I hadn't tested that scenerio specifically. First guess is that it's a bug in the uComponent 4.x code for MNTP's model-binding, as Umbraco core cast the value to a string before passing it to the model-binder.
umbraco 4.8.1, uComponent 4 and DynamicXml
Hello,
With uComponent 3.1 (and umbraco 4.8.1), we used BaseElement from DynamicXml to parse the uComponents (MNTP, "multiple text string" etc...)
So it was something like :
foreach (XElement item in Model.MyMNTP.BaseElement.Elements("nodeId")) {...}
same for multiple text string.
After upgrading to uComponent 4, it seems that the mapping/Razor bidding has changed.
The MultiNodeTree Picker is a now a list of DynamicNode and the multiple text string is a List of String.
It makes sence and it's easier to use but it broked all our code :)
I'm OK rewritting the code (it'll be cleaner) but I'm worried about uComponent 5
So my question is : will it be the same mapping in uCompenent 5 ?
I trying to anticipate to not have to rewrite the code again => if the mapping/Razor bidding will change from uCompoenent 4 to 5, I guess I could get the property as a string and create a DynamicXml object out of it (so I don't get affected by changes on the mapping)
Thank you very much for your answer
Best Regards
Fabrice
Hi Fabrice,
I hear your frustrations. We enabled the Razor model binding by default, as it was a much requested feature for uComponents. We have added an option to disable the model binding, by adding this to your Web.config AppSettings:
This will revert back to the default/raw value - as per uComponents v3.x.
... and yes, the mappings are the same with v5.x
This option is part of the package's post-install screen... we weren't intentionally hiding it. :-)
Cheers, Lee.
Hello Lee,
Thanks for your reply. I saw it after my question and I was actually just tested it.
I checked "Disable Razor model binding" in uComponent 4 and create 2 MNTP : one from umbraco 4.8.1 and one from uComponent 4
When I do in Razor : Model.myMNTPUmbraco and Model.myMNTPUcomponent =>
Do you know why the myMNTPUcomponent is not a DynamicXml ?
Interesting! I hadn't tested that scenerio specifically. First guess is that it's a bug in the uComponent 4.x code for MNTP's model-binding, as Umbraco core cast the value to a string before passing it to the model-binder.
I'll need to do some testing. Would you mind creating a ticket on our Issue Tracker please? http://ucomponents.codeplex.com/WorkItem/Create Then I can schedule it in very soon.
Thanks, Lee.
ok super thank you very much.
I have created the issue here :
http://ucomponents.codeplex.com/workitem/14749
is working on a reply...