Count selected items using ucomponents Multitreepicker
Hi all,
I hope some one can help me. I have a list of nodes, where I can choose some items using ucomponents multitreepicker.
I want to be able to count how many is selected with "Sport", "Movies" etc. I can choose more than one item on each nodes.
What i have so so far is that I make a varbriable that loops throug all nodes, and that's returning a list of id's seperatede with comma <xsl:variable name="inter"> <xsl:for-each select="$currentPage/ancestor::*//MedlemsContainer//Medlem/wwMinteresser"> <xsl:value-of select="."/> </xsl:for-each> </xsl:variable>
Now I what to count each selected items, but it returns a zero?
If you're storing as XML (not CSV) it should be possible with a simple call to count() with some XPath jugglery... can you show a little bit about the structure in Contents - it's a little hard to grasp from the description... ?
Hi Chriztian, Thanks for your reply. I'm storing as XML
My structure in Content is like this: I have a Folder called InteresseContainer. Underneath I have my nodes to selected in the multi treepicker. (like Sport, Movies etc..)
To get to my node with the the multitreepicker the structure is like this : - MedlemsContainer - AlphabetFolder - Medlem
The two folders InteresseContainer and MedlemsContainer are both at level 1
I've checked all the aliases and property and they are allright, but it doesn't show anything, not even the @nodeName. There is no errors on the page and no errors when I save the XSLT?
Yes, that help. But it seems like the count is wrong. I get (0) for each @nodeName and that's not completely right. There is selected some. Mabye it's becourse of my reading wrong about XLM and CSV like my former post?
Count selected items using ucomponents Multitreepicker
Hi all,
I hope some one can help me.
I have a list of nodes, where I can choose some items using ucomponents multitreepicker.
I want to be able to count how many is selected with "Sport", "Movies" etc.
I can choose more than one item on each nodes.
What i have so so far is that I make a varbriable that loops throug all nodes, and that's returning a list of id's seperatede with comma
<xsl:variable name="inter">
<xsl:for-each select="$currentPage/ancestor::*//MedlemsContainer//Medlem/wwMinteresser">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:variable>
Now I what to count each selected items, but it returns a zero?
<xsl:value-of select="count($currentPage/ancestor::*//MedlemsContainer//Medlem [$inter='1242'])"/>
What do I do wrong?
Palle
Does any one have an idea?
Palle
Hi Palle,
If you're storing as XML (not CSV) it should be possible with a simple call to count() with some XPath jugglery... can you show a little bit about the structure in Contents - it's a little hard to grasp from the description... ?
/Chriztian
Hi Chriztian,
Thanks for your reply.
I'm storing as XML
My structure in Content is like this:
I have a Folder called InteresseContainer. Underneath I have my nodes to selected in the multi treepicker. (like Sport, Movies etc..)
To get to my node with the the multitreepicker the structure is like this :
- MedlemsContainer
- AlphabetFolder
- Medlem
The two folders InteresseContainer and MedlemsContainer are both at level 1
Hope that can help.
Palle
Alright,
This should get you started then:
/Chriztian
Hi again Chriztian,
I've checked all the aliases and property and they are allright, but it doesn't show anything, not even the @nodeName.
There is no errors on the page and no errors when I save the XSLT?
What could be wrong yuo think?
Palle
Ahh sorry my fault....
I've looked at the wrong datatype. I'm storing as CSV, so what to do when I'm using that?
Could you try to help in that way?
Palle
Hi Palle,
Then the two containers may not be at level 1 afterall - are they below "Content" or below a "Home" (or similar) node?
Try adding an extra slash to those, just to check that they are in fact in the XML:
- this is very inefficient, but should work if they are somewhere in the tree... Does that help?
/Chriztian
Hi Chriztian,
Yes, that help.
But it seems like the count is wrong. I get (0) for each @nodeName and that's not completely right. There is selected some.
Mabye it's becourse of my reading wrong about XLM and CSV like my former post?
Palle
Hi Palle,
Yeah I wrote that reply while you wrote the other one in between.
So, yes - you need to store as XML for that to work, however, it should be possible to create a workaround for using CSV.
It should be something like this:
/Chriztian
Hi Chriztian,
Thanks. That did the trick.
And sorry for the mix up with XML and CSV
Thanks again.
Palle
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.