Copied to clipboard

Flag this post as spam?

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


  • Murray Roke 503 posts 967 karma points c-trib
    Nov 03, 2011 @ 05:31
    Murray Roke
    0

    MultiUrlPickerState.Deserialize returns count of 0

    Hi, I run the code below and I get no items, am I doing something wrong?

    {uComponents.Core.DataTypes.MultiUrlPicker.Dto.MultiUrlPickerState}
        Items: Count = 0
    
       var urls = uComponents.Core.DataTypes.MultiUrlPicker.Dto.MultiUrlPickerState.Deserialize(@"<multiurlpicker>
      <urlpicker mode=""Content"">
        <newwindow>True</newwindow>
        <nodeid>1070</nodeid>
        <url>/list-of-stuff/a-bit-of-stuff/</url>
        <linktitle />
      </urlpicker>
      <urlpicker mode=""URL"">
        <newwindow>True</newwindow>
        <nodeid />
        <url>http://www.google.co.nz</url>;
        <linktitle />
      </urlpicker>
      <urlpicker mode=""Media"">
        <newwindow>True</newwindow>
        <nodeid>1088</nodeid>
        <url>/media/756/lobsterlarge.jpg</url>
        <linktitle />
      </urlpicker>
      <urlpicker mode=""Upload"">
        <newwindow>True</newwindow>
        <nodeid />
        <url>/media/1438/SampleDocument.pdf</url>
        <linktitle />
      </urlpicker>
    </multiurlpicker>");
    
  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Nov 06, 2011 @ 16:54
    Lee Kelleher
    0

    Hi Murray,

    Are you manually building the XML? As the node/element names are incorrect for Multi-UrlPicker, see the documentation for an example: http://ucomponents.codeplex.com/wikipage?title=MultiUrlPicker&referringTitle=Documentation

    Cheers, Lee.

  • Murray Roke 503 posts 967 karma points c-trib
    Nov 06, 2011 @ 22:04
    Murray Roke
    0

    Doh, that's it, no I'm not building it manually, it's because razor has decided to remove the dashes.

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Nov 07, 2011 @ 10:53
    Lee Kelleher
    0

    Hi Murray,

    Wasn't aware that the Razor engine stripped the dashes.  Work has been done on creating proper models for uComponents data-types in Razor, take a look at the source on CodePlex: http://razordatatypemodels.codeplex.com/  We have made a start to package it up (run the BuildPackage.cmd in the Build folder) - or build the source and drop the DLL into your /bin folder (note, this will only work with Umbraco v4.7.1+)

    Cheers, Lee.

  • 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