How to declared a variable using tamino

I have two nested bdm:loop.
How do i declared a variable to store the position of the outer loop.



X-Application Version: 3.1.2, 3.1.1
Tamino Version : 3.1.1
Platform : NT, Win2k, Solaris, …
WebContainer : Tomcat 3.3
JDK Version : 1.3.1

Hello,

when receiving your request I asked my colleagues if they have an idea how to solve your problem. The result is that we don?t know a simple way to assign the output of a tag to an embedded Java variable.

However, the following two approaches could help you:


  • Access the page object which maintains the loop and request the current position. An example could look like this:

    <%@ page import=“com.softwareag.xtools.xapplication.jsp” %>

    <% SessionContext sessionContext = ServletSessionContext.getSessionContext(pageContext); %>
    <% int loopCount = 0; %>

    <bdm:loop … targetbase=“myLoop”>
    <% int pos = sessionContext.getPage(“myLoop”).getPageStartElementNo() + 1 + loopCount; %>

    <% loopCount++; %>
    </bdm:loop>

  • Derive a tag from the display tag which stores the position into the servlets session context and request this information within the embedded Java code.


It is just a proposal. I did not try out this code. There may be typos. If the first approach does not work, write a new post if you need more information how to implemented the second one.

Bye,
Christian.

[This message was edited by Christian Freytag on 07 May 2002 at 07:24.]