Copied to clipboard

Flag this post as spam?

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


  • John C Scott 473 posts 1183 karma points
    Apr 26, 2011 @ 18:09
    John C Scott
    1

    empty data with XPath CheckBoxList

    it's my first day of using uComponents and it's the most productive one I can remember - however I'm having a problem with the XPath CheckBoxList that's driving me a little bit nuts. It's a new site on 4.7 and everything seems to be ok, also using uQR and fam-fam-fam.

    setting up the xpath checkboxlist data type was wonderfully simple and this seems to work, and when I select some nodes and publish the document it saves the choices, and I can come back and the selections I've made are there.

    but when i try and view the saved property either using the field picker straight into the template or xslt i always get blank - i've tried as csv/xml/node name/noide id but it's always the same, i was hoping to at least just see the xml or what's saved before trying to write something to process it.

    it did occur to me that it may be XML and so wouldn't render so tried a copy-of with output escaping in an xslt preview just to be sure

    any ideas where i might be going wrong with this?

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Apr 26, 2011 @ 18:12
    Lee Kelleher
    0

    Hi John,

    Check if the data is being published to the /App_Data/umbraco.config ... to see what's coming through?

    Cheers, Lee.

  • John C Scott 473 posts 1183 karma points
    Apr 26, 2011 @ 19:55
    John C Scott
    0

    will do - thanks for the good idea

     

  • John C Scott 473 posts 1183 karma points
    Apr 26, 2011 @ 19:58
    John C Scott
    0

    in short yes

    very odd

            <teamName>Programmers</teamName>
            <Crew id="1063" parentID="1062" level="4" writerID="0" creatorID="0" nodeType="1056" template="1072" sortOrder="1" createDate="2011-04-26T13:56:44" updateDate="2011-04-26T14:25:54" nodeName="John Scott" urlName="john-scott" writerName="John Scott" creatorName="John Scott" path="-1,1048,1057,1062,1063" isDoc="">
              <crewName>John Scott</crewName>
              <crewMealsAssigned>
                <XPathCheckBoxList>
                  <nodeId>1058</nodeId>
                  <nodeId>1059</nodeId>
                </XPathCheckBoxList>
              </crewMealsAssigned>
              <crewMealsRedeemed>
                <XPathCheckBoxList>
                  <nodeId>1058</nodeId>
                </XPathCheckBoxList>
              </crewMealsRedeemed>
            </Crew>
          </Team>

     

  • John C Scott 473 posts 1183 karma points
    Apr 27, 2011 @ 11:18
    John C Scott
    1

    Ok so I am being a bit daft.

    You can't display this as an Umbraco field in a template and there is no good reason why you should. This makes sense it just seems to ignore the XML in the field and why wouldn't it. Then when I put it into an XSLT I forgot to add $currentPage/

    Please don't tell anyone just how daft i am being.

    Leave that to me.

    Sadly I can't mark my own post as the solution, so someone still needs to contribute a considerately thought through suggestion that I can mark. For the record I would not regard place head in oven and start gas as considerate.

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Apr 27, 2011 @ 11:28
    Lee Kelleher
    0

    Hi John, take yor head out of the oven... easy mistake to make! ;-)  Your secret is safe with me.

    Cheers, Lee.

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Apr 27, 2011 @ 11:52
    Hendy Racher
    1

    Hi John,

    Good to hear you have it working :)

    BTW, to display the values in a template how about something like: (although binding to a repeater would probably be nicer)

    <%@ Import Namespace="umbraco.presentation.nodeFactory" %>
    <%@ Import Namespace="uComponents.Core" %>
    <%@ Import Namespace="uComponents.Core.uQueryExtensions" %>

    <%
    foreach(Node mealNode in uQuery.GetNodesByXml(
    uQuery.GetCurrentNode()
    .GetProperty<string>("crewMealsAssigned")))
    {
    %>


    <% = mealNode.Name %>

    <%
    }
    %>

    Hendy

Please Sign in or register to post replies

Write your reply to:

Draft