Copied to clipboard

Flag this post as spam?

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


  • James Kahler 36 posts 78 karma points
    Aug 28, 2013 @ 14:17
    James Kahler
    0

    XML dropdownlist

    Just installed ucomponents 5.5 on umbraco 6.1.3. 

    Was installing it to use the xml dropdownlist. Now for some reason when i go to add a new datatype the xml dropdownlist isn't there.

    Can anyone shed any light on this? The package installed sucessfully!

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Aug 29, 2013 @ 11:08
    Lee Kelleher
    0

    Hi James,

    The XML DropDownList is in the upcoming v6.0 release.

    We've got a latest build of the package up on CodePlex:
    https://ucomponents.codeplex.com/releases/view/97718

    (It's pretty stable - as I'm using it on several projects)

    Cheers,
    - Lee

  • William Charlton 171 posts 218 karma points
    Jan 07, 2014 @ 16:02
    William Charlton
    0

    Hi Lee,

    I have a site using a Contour form with one of the dropdown fields populated from a text file (I know, so last century). I'd like to use the same list to populate a dropdown for Members in the back office. Can uComponents do this? At worst I could copy the text file and convert to an xml file but I'd like to keep the list in one place. And is XML Dropdown list out of beta?

    Incidentally the list is a Language List so in an ideal world I'd use the built-in list of languages but I guess that's being to hopeful.

     

    Thanks William

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jan 07, 2014 @ 16:31
    Lee Kelleher
    0

    Hi William,

    The XML DropDownList is out of beta in the latest uComponents (v6), but it doesn't handle plain-text/delimited files.

    For the member's data-type, if you want to re-use the same text file, then I'd advise writing a custom data-type, (inheriting from the AbstractDataEditor class). For an example, take a look at the source for the XmlDropDownList.

    https://github.com/leekelleher/uComponents/blob/master/src/uComponents.DataTypes/XmlDropDownList/XmlDropDownListDataType.cs

    I have a couple of other examples of ad-hoc data-types that I'd made to solve specific problems.

    With these 2, I just dropped the class into my /App_Code folder.
    Ultimately you can load in whatever you want in the m_Control_Init method.

    Cheers,
    - Lee

  • William Charlton 171 posts 218 karma points
    Jan 07, 2014 @ 17:27
    William Charlton
    0

    Thanks a lot Lee, That got me out of a hole but it is still (in my slightly obsessive mind) a bit untidy. I'll look to see if Contour can use the same class. It should, I'll let you know.

    So, going back to my original post, does uComponents XML dropdown now work? If it does that might be a neater solution and maybe Contour could use the same datatype?

    BTW I'm running Umb 6.1.6, which I thought already included uComponents?

    Update
    It seems Contour doesn't like the new datatype, no surprise there then.

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jan 07, 2014 @ 17:45
    Lee Kelleher
    0

    Yes, XML DropDownList works.

    As for uComponents being part of the Umbraco core - we've been moving over individual data-types, (MNTP, XPath lists), not the entire package. But people started to tweet "uComponents is in the core" - so people assumed it was all of it.

  • William Charlton 171 posts 218 karma points
    Jan 07, 2014 @ 18:53
    William Charlton
    0

    I have just installed uComponents (mistakenly I installed 5.5.4 first so had to uninstall and reinstall 6.0.0 for the xml list). I am getting an error on (I think) the XPath.

    I have:

    <LanguageList>
        <Language id="0" Name="Select a language"/>
        <Language id="1" Name="Afrikaans"/>
    etc..
    </LanguageList>

    XPath Expression: /LanguageList/Language

    Text column: @Name

    Value column: @id

    But I'm now getting:

    DataBinding: 'System.Web.UI.WebControls.XmlDataSourceNodeDescriptor' does not contain a property with the name '@Name'.


    Am I missing something? Does XML List require elements rather that attributes?

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jan 07, 2014 @ 18:56
    Lee Kelleher
    0

    Try removing the "@" prefix - I think the XmlDataSource (used internally) doesn't require it for attributes.

  • William Charlton 171 posts 218 karma points
    Jan 07, 2014 @ 19:06
    William Charlton
    0

    :) First I tried converting all the attributes to elements, removed the @ (because they are elements) but that didn't work either. I converted it all back and did as you say and now it's sweet. Thanks a lot.

    Maybe we could add this to the docs, perhaps with an example of the XML structure so users can see how the xpath works?

    Now I'll try Contour - fingers crossed.

    Update

    Hmm No joy, not sure why Tim (or whoever built Contour) went a different route, maybe he had his reasons

Please Sign in or register to post replies

Write your reply to:

Draft