Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • fabrice 104 posts 227 karma points
    Aug 30, 2012 @ 10:32
    fabrice
    0

    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

     

     

     

     

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Aug 30, 2012 @ 11:03
    Lee Kelleher
    0

    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:

    <add key="ucomponents:RazorModelBinding" value="false" />

    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.

  • fabrice 104 posts 227 karma points
    Aug 30, 2012 @ 11:12
    fabrice
    1

    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 =>

    • The myMNTPUmbraco from umbraco is a DynamicXML

     

    • but the myMNTPUcomponent from uComponent 4 is a string (containing the XML)

    Do you know why the myMNTPUcomponent is not a DynamicXml ?

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Aug 30, 2012 @ 11:19
    Lee Kelleher
    0

    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.

  • fabrice 104 posts 227 karma points
    Aug 30, 2012 @ 11:31
    fabrice
    1

    ok super thank you very much.

    I have created the issue here :

    http://ucomponents.codeplex.com/workitem/14749

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies