I don't have support of getNodeDataCollection in Freemarker, it is EL Function 
Tag-lib.

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Zdenek Skodik
Gesendet: Donnerstag, 3. Februar 2011 10:14
An: Magnolia User-List
Betreff: Re: [magnolia-user] Freemarker Mail Multiple Parameters


Hi,

for controls like checkboxes that can have multiple values, the way it's stored 
in repository is as a content node with as many node datas as values selected.
Something along this:
mycheckbox         //content node
  0 value1         //property
  1 value2         //property
So you can i.e. iterate through content.getNodeDataCollection(String 
namePattern) and get the values.

More general approach would be to use the ContentUtil.visit method to iterate 
through all nodes of the page to find out matching property names.
Something along this (copy/paste/customize from wiki):

ContentUtil.visit(node, new ContentUtil.Visitor(){
    public void visit(Content subNode) throws Exception {
        if(subNode.getName().equals("the_thing_you_are_looking_for") {
            final Collection properties = subNode.getNodeDataCollection();
            ......


HTH,
-zdenek
                                                                                
                                                                                
                                                                                
                                      


On Thu, 2011-02-03 at 09:43 +0100, Anton Matheis wrote:
> Hi,
> 
> there is a comment in WebContextImpl at the method "public Map<String,
> String> getParameters()".
> It says:
> 
>  * Get parameter values as a Map<String, String> (unlike
> HttpServletRequest.getParameterMap() which returns a Map<String,
>      * String[]>, so don't expect to retrieve multiple-valued form
> parameters here)
>      * @return parameter values
> 
> Just sounded familiar and so i looked it up, i haven't verified
> whether that's your problem's cause. Is it?
> 
> Greetings,
> Anton
> 
> 
> On Wed, Feb 2, 2011 at 8:20 PM, Marvin Kerkhoff
> <[email protected]> wrote:
> >
> > :-( Sorry that was also the first idea i have, but this doesn't work. It's 
> > totaly crazy i've feel i am on the first class elementary school.
> > ________________________________________
> > Von: [email protected] [[email protected]] im 
> > Auftrag von Ries van Twisk [[email protected]]
> > Gesendet: Mittwoch, 2. Februar 2011 17:45
> > An: Magnolia User-List
> > Betreff: Re: [magnolia-user]  Freemarker Mail Multiple Parameters
> >
> > This is a very wild guess,
> >
> > but try this:
> >
> > <label><input type="checkbox" name="infomaterial[0]" value=" Test1" /> 
> > Test1</label>
> > <label><input type="checkbox" name="infomaterial[1]" value=" Test2" /> 
> > Test2</label>
> > <label><input type="checkbox" name="infomaterial[2]" value=" Test3" /> 
> > Test3</label>
> >
> > Or this:
> >
> > <label><input type="checkbox" name="infomaterial[]" value=" Test1" /> 
> > Test1</label>
> > <label><input type="checkbox" name="infomaterial[]" value=" Test2" /> 
> > Test2</label>
> > <label><input type="checkbox" name="infomaterial[]" value=" Test3" /> 
> > Test3</label>
> >
> >
> > Ries
> >
> >
> > On Feb 2, 2011, at 10:34 AM, Marvin Kerkhoff wrote:
> >
> > Hi there,
> >
> > i have following problem. I've used checkboxes with the same name, so it is 
> > an mutiple checkbox.
> >
> > <label><input type="checkbox" name="infomaterial" value=" Test1" /> 
> > Test1</label>
> > <label><input type="checkbox" name="infomaterial" value=" Test2" /> 
> > Test2</label>
> > <label><input type="checkbox" name="infomaterial" value=" Test3" /> 
> > Test3</label>
> >
> > Now. How can i used this in Freemarker after the form is send. I have tried:
> >
> > [#list ctx.infomaterial as x]
> > ${x}
> > [/#list]
> >
> > But ctx.infomaterial is only a string with the first clicked checkbox value.
> > Thanks for your help.
> >
> >
> >
> >
> > ________________________________
> > ----------------------------------------------------------------
> > For list details see
> > http://www.magnolia-cms.com/home/community/mailing-lists.html
> > To unsubscribe, E-mail to: 
> > <[email protected]<mailto:[email protected]>>
> > ----------------------------------------------------------------
> >
> >
> >
> > ________________________________
> > ----------------------------------------------------------------
> > For list details see
> > http://www.magnolia-cms.com/home/community/mailing-lists.html
> > To unsubscribe, E-mail to: <[email protected]>
> > ----------------------------------------------------------------
> >
> >
> > ----------------------------------------------------------------
> > For list details see
> > http://www.magnolia-cms.com/home/community/mailing-lists.html
> > To unsubscribe, E-mail to: <[email protected]>
> > ----------------------------------------------------------------
> >
> >
> 
> 
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to