Is your markup like this? <@group name="qname1" label="Header" render="collapse" id="header"> <@select name="select1" /> </@group>
<@group name="qname2" label="Header" render="collapse" id="header"> <@select name="select2" /> </@group> and you need to know the name of `qname2` when you call `select1`? If so, you would need to store the value of `qname2` in a variable that is above the first group. <#assign groupName2 = "qname2"> <@group name="qname1" label="Header" render="collapse" id="header"> <@select name="select1" someParam=groupName2 /> </@group> <@group name=groupName2 label="Header" render="collapse" id="header"> <@select name="select2" /> </@group> You can't "look ahead" because the template engine doesn't know what is going to be defined until it gets defined. (e.g. no "hoisting" happens) On Fri, Dec 4, 2015 at 11:44 AM, Ingo Mahnke <[email protected]> wrote: > > Hallo! > I am new to freemarker and I have one question perhaps sombody can help me. > I have two own directives written in Java and one Template: > > > <@group name="qname" label="Header" render="collapse" id="header"> > <@select name="kjkjk"/> > </@group> > > When I am inside the execute method of "select" I need access to the next > parent "group"-Element and I need the > value of the "name" attribute. Is this kind of communication between > directives possible? > > > Thank you! > Ingo >
