Skip to main content
aboutsummaryrefslogblamecommitdiffstats
blob: e6a6b8aa2d0a697da54aab3ee50e449dc6a79a53 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                                
                                  




















                                                                                                                                              
<!-- **************************************************************************
#
# Copyright (c) 2010, CollabNet
#
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors: 
#
#   
#        
#
#************************************************************************** --> 


<?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">
  <st:documentation>
    Renders inline an optional single-value nested data-bound property of the current instance,
    by using a &lt;f:optionalBlock>

    This is useful when your object composes another data-bound object, and when that's optional,
    where the absence of the value is signified as null (in which case the optionalBlock will be drawn unchecked),
    and the presence of the value.
    <st:attribute name="field" use="required" />
    <st:attribute name="title" use="required" />
  </st:documentation>
  <!--
    Without @checked, optionalBlock will try to coarse an obejct to a boolean, which fails,
    so override @checked manually.
  -->
  <f:optionalBlock field="${field}" title="${title}" checked="${instance[field]!=null}">
    <j:set var="descriptor" value="${app.getDescriptorOrDie(descriptor.getPropertyType(instance,field).clazz)}" />
    <j:set var="instance" value="${instance[field]}"/>
    <st:include from="${descriptor}" page="${descriptor.configPage}" />
  </f:optionalBlock>
</j:jelly>

Back to the top