Copied to clipboard

Flag this post as spam?

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


  • Petr Snobelt 923 posts 1535 karma points
    Mar 18, 2012 @ 22:00
    Petr Snobelt
    0

    Where and XPathCheckBoxList

    Hi,

    I try to use something like this 

    @Model.Where("cities.Contains(\"Zlín\")")

    but it don't work. 

    Property city is defined as XPathCheckBoxList from uComponents.

    Is there any workaround or miss I something?

     

    Thanks

     

     

  • Ben McKean 272 posts 549 karma points
    Jan 30, 2013 @ 12:57
    Ben McKean
    0

    Did you find a fix for this? I'm having same issue

  • Petr Snobelt 923 posts 1535 karma points
    Feb 04, 2013 @ 20:34
    Petr Snobelt
    0

    I ended with something like this:

    Func cityDiscountsFilter = delegate(DynamicBackingItem node)
            {
                var cities = node.GetPropertyValue("cities");
                return cities.Contains(CurrentCity);
            };
    var root = @Model.AncestorOrSelf();
    var cityDiscounts = root.Descendants(cityDiscountsFilter);
    
  • Petr Snobelt 923 posts 1535 karma points
    Feb 04, 2013 @ 20:41
    Petr Snobelt
    0

    Maybe it's fixed in new version of uComponents

    http://ucomponents.codeplex.com/SourceControl/changeset/26d67e1a7921

     

  • Petr Snobelt 923 posts 1535 karma points
    Feb 04, 2013 @ 20:43
    Petr Snobelt
    0

    Or maybe it can be solved by using http://razordatatypemodels.codeplex.com/

  • Andy 7 posts 26 karma points
    Sep 30, 2013 @ 11:00
    Andy
    0

    I am experiencing the same issue trying to filter nodes based matching values in a XPathCheckBoxList (Umbraco 6.1.5)

    var nodes = Model.AncestorOrSelf().Descendants().Where("articleExpertiseTags == 1068);

    <articleExpertiseTags>

                <XPathCheckBoxList>

                  <nodeId>1068</nodeId>

                  <nodeId>1070</nodeId>

                </XPathCheckBoxList>

    </articleExpertiseTags>

  • Matt Bliss 176 posts 234 karma points c-trib
    Sep 30, 2013 @ 14:37
    Matt Bliss
    0

    Hi Andy,

    Have you tried using uQuery GetNodesByXml? It is part of uComponents and designed as a helper for those legacy xpath data types.

    Hope that helps,
    Matt

  • Andy 7 posts 26 karma points
    Sep 30, 2013 @ 15:22
    Andy
    0

    Thanks I will have a look. Can you suggest a more appropriate data type to use instead?

Please Sign in or register to post replies

Write your reply to:

Draft