Copied to clipboard

Flag this post as spam?

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


  • Sean Dooley 289 posts 528 karma points
    Sep 01, 2011 @ 12:50
    Sean Dooley
    0

    autocomplete and members

    I am trying to iterate over members stored as a uComponents autocomplete property. The data is stored as <members>1088,1095</members>

    @Model.Members returns 10881095

    Using an example similar to the one on uComponents codeplex page, returns nothing.

    var memberList = uQuery.GetMembersByCsv(@Model.GetProperty<string>("members").ToString());
    foreach(var member in memberList) {
    @member
    }

    Any ideas?

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Sep 01, 2011 @ 13:02
    Hendy Racher
    0

    Hi Sean,

    does @Model.Members return the the integers comma seperated ?

    alternatively how about:

    var memberList = uQuery.GetMemebersByCsv(uQuery.GetCurrentNode().GetProperty<string>("members"));

    HTH,

    Hendy

  • Sean Dooley 289 posts 528 karma points
    Sep 01, 2011 @ 15:39
    Sean Dooley
    0

    Hi Hendy

    @Model.Members returns the data as one value '10881095'

    The following code returns "The non-generic method 'umbraco.presentation.nodeFactory.Node.GetProperty(string)' cannot be used with type arguments"

    var memberList = uQuery.GetMembersByCsv(uQuery.GetCurrentNode().GetProperty<string>("members"));

    The following code returns "The best overloaded method match for 'uComponents.Core.uQuery.GetMembersByCsv(string)' has some invalid arguments"

    var memberList = uQuery.GetMembersByCsv(@Model.GetProperty<string>("members"));

    The following code returns ""

    var memberList = uQuery.GetMembersByCsv(@Model.GetProperty<string>("members").ToString());

    Any ideas?

     

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Sep 01, 2011 @ 15:44
    Hendy Racher
    0

    Hi Sean,

    the error about "The non-generic method 'umbraco.presentation.nodeFactory.Node.GetProperty(string)' cannot be used with type arguments" is because it's trying to use the GetProperty method of the Umbraco Node obj, rather the uQuery extension method on the Node obj - to fix that add:

    using uComponents.Core.uQueryExtensions;

    HTH,

    Hendy

Please Sign in or register to post replies

Write your reply to:

Draft