Skip to main content
blob: 039f95d209ff6dbf9ac6b1345b299fad009f8ef2 (plain) (tree)











<!-- **************************************************************************
# Copyright  (c) 2004-2011 Oracle Corporation.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# Contributors: 
#    Kohsuke Kawaguchi, Nikita Levyankov
#************************************************************************** --> 

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:local="local">
    Outer most tag for creating a heterogeneous list, where the user can choose arbitrary number of
    arbitrary items from the given list of descriptors, and configure them independently.

    The submission can be data-bound into List&lt;T> where T is the common base type for the describable instances.
    <st:attribute name="name" use="required">
      form name that receives an array for all the items in the heterogeneous list.
    <st:attribute name="items" use="required" type="java.util.Collection">
      existing items to be displayed. Something iterable, such as array or collection.
    <st:attribute name="descriptors" use="required">
      all types that the user can add.
    <st:attribute name="addCaption">
      caption of the 'add' button.
    <st:attribute name="deleteCaption">
      caption of the 'delete' button.
    <st:attribute name="targetType">
      the type for which descriptors will be configured. Defaults to ${it.class} (optional)
    <st:attribute name="hasHeader">
      For each item, add a caption from descriptor.getDisplayName().
      This also activates drag&amp;drop (where the header is a grip), and help text support.
    <st:attribute name="isPropertyOverridden">
      if present and true - value is overridden
    <st:attribute name="resetUrl">
      If present, Redo icon will rendered and Reset will be available.
  <d:taglib uri="local">
    <d:tag name="body">
      <table style="width:100%">
        <j:set var="help" value="${descriptor.helpFile}" />
        <j:if test="${hasHeader}">
            <td colspan="3">
              <div class="dd-handle">
            <j:if test="${help!=null}">
                <a href="#" class="help-button" helpURL="${rootURL}${help}"><img src="${imagesURL}/16x16/help.png" alt="[help]"/></a>
          <!-- TODO: help support is unintuitive; people should be able to see help from drop-down menu -->
          <j:if test="${help!=null}">
            <f:helpArea />
        <!-- optional added to keep from breaking page rendering when
        a descriptor doesn't have a config.jelly. -->
        <st:include from="${descriptor}"
                    page="${descriptor.configPage}" optional="true" />
          <div align="right">
            <input type="hidden" name="stapler-class" value="${}" />
            <f:repeatableDeleteButton value="${attrs.deleteCaption}" />
      <input type="hidden" name="kind" value="${}" />
   <j:if test="${attrs.isPropertyOverridden==null}">
    <j:set target="${attrs}" property="isPropertyOverridden" value="false"/>
  <j:set var="targetType" value="${attrs.targetType?:it.class}"/>
  <j:if test="${attrs.isPropertyOverridden and !empty(attrs.resetUrl)}">
    <div class="hetero-list-reset">
      <a href="#" class="reset-button" resetURL="${resetUrl}">
        <img src="${imagesURL}/16x16/undo.png" alt="Reset ${title}"/>
  <div class="hetero-list-container${hasHeader?' with-drag-drop':''}${attrs.isPropertyOverridden? ' modified' :''}">
    <!-- display existing items -->
    <j:forEach var="i" items="${attrs.items}">
      <j:set var="descriptor" value="${i.descriptor}" />
      <j:set var="instance" value="${i}" />
      <div name="${}" class="repeated-chunk">
        <local:body deleteCaption="${attrs.deleteCaption}" />

    <div class="repeatable-insertion-point" />
    <div class="prototypes to-be-removed">
      <!-- render one prototype for each type -->
      <j:set var="instance" value="${null}" />
      <j:forEach var="descriptor" items="${attrs.descriptors}" varStatus="loop">
        <div name="${}" title="${descriptor.displayName}" tooltip="${descriptor.tooltip}">
          <local:body deleteCaption="${attrs.deleteCaption}" />

      <input type="button" value="${attrs.addCaption?:'%Add'}" class="hetero-list-add" />

Back to the top