Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » passing multiple variables in JET2 control tag <c:iterate>
passing multiple variables in JET2 control tag <c:iterate> [message #51838] Fri, 22 September 2006 10:20 Go to next message
Lakshmi is currently offline LakshmiFriend
Messages: 14
Registered: July 2009
Junior Member
How to pass multiple variables in a JET control tag for instance Iterate.

<c:iterate select="value" var="p">

content of iterate

</c:iterate>

If I want to have another variable called q in the var= "p,q" .. How to
declare this another variable. Is it possible in the first instance??

Any help regarding this will be appreciated.

Thanks
Lakshmi
Re: passing multiple variables in JET2 control tag <c:iterate> [message #52034 is a reply to message #51838] Fri, 22 September 2006 13:15 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Lakshmi:

The variable created by <c:iterate> refers to the current instance of the
collection of objects identified by evaluating the 'select' expression. It
makes no sense to me to define multiple variables refering to that object.
The body of the <c:iterate> can reference other variables than just the one
created in the tag - it may access any currently defined variable.

An example: If you hand a model like this:

<company name="ABC Inc">
<person name="Jim">
<skill technology="Java"/>
<skill technology="JET"/>
</person>
<person name="Bob">
<skill technology="Cobol"/>
<skill technology="JET"/>
</person>
</company>

A very typical way to traverse this would be:

<c:setVariable select="/company" var="$company"/>

<c:iterate select="$company/person" var="person">
<%-- here you can access $companyand $person --%>
<c:iterate select="$person/skill" var="skill">
<%-- here you can access $company, $person and $skill --%>
Person <c:get select="$person/@name"/> with skill <c:get
select="$skill/@technology"/> works at <c:get select="$company/@name"/>.
</c:iterate>
</c:iterate>

Let me know if I've misunderstood your question.

Paul Elder
JET Lead Developer

"Lakshmi" <visalakshmi@hotmail.com> wrote in message
news:996490bb09a7085f4e836e27238baf7f$1@www.eclipse.org...
> How to pass multiple variables in a JET control tag for instance Iterate.
>
> <c:iterate select="value" var="p">
>
> content of iterate
>
> </c:iterate>
>
> If I want to have another variable called q in the var= "p,q" .. How to
> declare this another variable. Is it possible in the first instance??
>
> Any help regarding this will be appreciated.
>
> Thanks
> Lakshmi
>
Re: passing multiple variables in JET2 control tag <c:iterate> [message #591751 is a reply to message #51838] Fri, 22 September 2006 13:15 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Lakshmi:

The variable created by <c:iterate> refers to the current instance of the
collection of objects identified by evaluating the 'select' expression. It
makes no sense to me to define multiple variables refering to that object.
The body of the <c:iterate> can reference other variables than just the one
created in the tag - it may access any currently defined variable.

An example: If you hand a model like this:

<company name="ABC Inc">
<person name="Jim">
<skill technology="Java"/>
<skill technology="JET"/>
</person>
<person name="Bob">
<skill technology="Cobol"/>
<skill technology="JET"/>
</person>
</company>

A very typical way to traverse this would be:

<c:setVariable select="/company" var="$company"/>

<c:iterate select="$company/person" var="person">
<%-- here you can access $companyand $person --%>
<c:iterate select="$person/skill" var="skill">
<%-- here you can access $company, $person and $skill --%>
Person <c:get select="$person/@name"/> with skill <c:get
select="$skill/@technology"/> works at <c:get select="$company/@name"/>.
</c:iterate>
</c:iterate>

Let me know if I've misunderstood your question.

Paul Elder
JET Lead Developer

"Lakshmi" <visalakshmi@hotmail.com> wrote in message
news:996490bb09a7085f4e836e27238baf7f$1@www.eclipse.org...
> How to pass multiple variables in a JET control tag for instance Iterate.
>
> <c:iterate select="value" var="p">
>
> content of iterate
>
> </c:iterate>
>
> If I want to have another variable called q in the var= "p,q" .. How to
> declare this another variable. Is it possible in the first instance??
>
> Any help regarding this will be appreciated.
>
> Thanks
> Lakshmi
>
Previous Topic:JET and EMF XML Persistence
Next Topic:Access JET Conext variables in jet
Goto Forum:
  


Current Time: Thu Dec 26 11:18:15 GMT 2024

Powered by FUDForum. Page generated in 0.03449 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top