Copied to clipboard

Flag this post as spam?

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


  • Steve Morgan 1348 posts 4457 karma points c-trib
    Apr 13, 2009 @ 20:49
    Steve Morgan
    0

    Checking Ultimate Picker Values

    I feel like I'm missing something obvious here...

    I have a number of owner nodes - these have an Ultimate Picker which selects regions. I have a a search page into which I pass a region. I want to spit out a list of all owners that have this area/region selected in the picker.

    I have seen other code examples using Contains but isn't there is a potential problem in this solution?!?..









  • [/code]

Copy Link
  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 13, 2009 @ 21:44
    Douglas Robar
    1

    You're right about the potential for contains() to be a bit too quick to match. There's a way around that, though.

    Keep in mind that you'll have commas between multiple items, so.... add a comma to both ends of the values returned by the ultimate picker so that you'll end up with a variable with ",1111,2222,". You can do this with the concat() function.

    [code][/code]

    (btw, it is best NOT to have spaces in your alias names... it just makes everything less error-prone)

    Once you've got your variable with commas everywhere, you can use the contains() test, and put commas on both sides of what you're looking for.

    [code][/code]


    As to your comment that your xslt macro is getting longer than you'd like... welcome to xslt! It must be the world's most verbose language. Even the classic "Hello, World!" can take a dozen lines.

    Hope this helps.

    cheers,
    doug.

    Copy Link
  • Nathan 16 posts 38 karma points
    Mar 05, 2010 @ 18:50
    Nathan
    0

    Hi Douglass,

    I'm trying to use this technique with GetXmlNodeById() where I'm passing in the source via Macro param.  How would I go about getting the hosting page's id (like the ',111,' listed above) with that approach?

    Let me know if I need to be more clear.

    Thanks,
    Nathan

    Copy Link
  • Nathan 16 posts 38 karma points
    Mar 05, 2010 @ 23:36
    Nathan
    0

    s--;  (sorry about that)

    I figured this out.  I just set a variable to the currentPage so that I can use it within the for-each loop.

    -N

    Copy Link
  • Please Sign in or register to post replies

    Write your reply to:

    Draft