commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Michael Reilly <...@pajato.com>
Subject [Jelly] Swing action objects
Date Fri, 28 Feb 2003 13:44:51 GMT
I have a question about using action objects in a loop, something
like:

...
<panel name="libPanel" var="libPanel">
  <j:forEach var="item" items="${manager.managedObjects}">
    <j:set var="panelName" value="${item.ID}IconPNL"/>
    <j:set var="buttonName" value="${item.ID}IconBTN"/>
    <j:set var="buttonIcon" value="${manager.getIcon(item)}"/>
    <panel name="${panelName}" var="${panelName}">
      <gridBagLayout>
        <gbc gridy="0" gridx="0" fill="none" anchor="center">
          <label text="${item.topCaption}"/>
        </gbc>
        <gbc gridy="1" gridx="0" fill="none" anchor="center">
          <button name="${buttonName}" var="buttonName">
            <action>
              <j:set var="tabTitle" value="${item.title}"/>
              <j:include uri="openContainerTab.xml" 
                         inherit="true" export="true"/>
            </action>
          </button>
          ${dccApp.registerButton( buttonName, buttonIcon, item )}
        </gbc>
        <gbc gridy="2" gridx="0" fill="none" anchor="center">
          <label text="${item.bottomCaption}"/>
        </gbc>
      </gridBagLayout>
    </panel>
  </j:forEach>
</panel>

The "openContainerTab.xml" script needs to have the tab title
generated in the loop and saved for use when the button is
activated.  I don't think the <action> element is this robust.  Nor
can I see clearly how to accomplish this without creating Java
support (registerButton).  Am I missing something obvious?

Is there an opportunity here to enhance Jelly is some useful fashion?

Thanks,

-pmr


Mime
View raw message