Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 4b0d337f1ba21352c08ec7df972f7f025f3e7c2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!-- **************************************************************************
#
# Copyright  (c) 2004-2009 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors: 
#
#    Kohsuke Kawaguchi, Yahoo!, Inc.
#        
#
#************************************************************************** --> 


<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:f="/lib/form">
  <st:documentation>
    Generates an input field <tt>&lt;input type="text" ... /></tt> to be
    used inside &lt;f:entry/>

    <st:attribute name="field">
      Used for databinding. TBD.
    </st:attribute>
    <st:attribute name="name">
      This becomes @name of the &lt;input> tag.
      If @field is specified, this value is inferred from it.
    </st:attribute>
    <st:attribute name="value">
      The initial value of the field. This becomes the @value of the &lt;input> tag.
      If @field is specified, the current property from the "instance" object
      will be set as the initial value automatically,
      which is the recommended approach.
    </st:attribute>
    <st:attribute name="default">
      The default value of the text box, in case both @value is and 'instance[field]' is null.
    </st:attribute>
    <!-- Tomcat doesn't like us using the attribute called 'class' -->
    <st:attribute name="clazz">
      Additional CSS class(es) to add (such as client-side validation clazz="required",
      "number" or "positive-number"; these may be combined, as clazz="required number").
    </st:attribute>
    <st:attribute name="checkMessage">
      Override the default error message when client-side validation fails,
      as with clazz="required", etc.
    </st:attribute>
    <st:attribute name="checkUrl">
      If specified, the value entered in this input field will be checked (via AJAX)
      against this URL, and errors will be rendered under the text field.

      If @field is specified, this will be inferred automatically,
      which is the recommended approach.
    </st:attribute>
  </st:documentation>
  <f:prepareDatabinding />
  <input class="setting-input ${attrs.checkUrl!=null?'validated':''} ${attrs.clazz}"
         name="${attrs.name ?: '_.'+attrs.field}"
         value="${attrs.value ?: instance[attrs.field] ?: attrs.default}"
         id="${attrs.id}"
         type="text"
         readonly="readonly"
         checkUrl="${attrs.checkUrl}" checkMethod="${attrs.checkMethod}"
         checkMessage="${attrs.checkMessage}"
         onchange="${attrs.onchange}" onkeyup="${attrs.onkeyup}"/>
</j:jelly>

Back to the top