PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/hudson-core/src/main/resources/lib/form/validateButton.jelly

http://github.com/hudson/hudson
Unknown | 65 lines | 58 code | 7 blank | 0 comment | 0 complexity | ff0586b8f82abd6324ef5bd5ec7a0c05 MD5 | raw file
 1<!--
 2The MIT License
 3
 4Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
 5
 6Permission is hereby granted, free of charge, to any person obtaining a copy
 7of this software and associated documentation files (the "Software"), to deal
 8in the Software without restriction, including without limitation the rights
 9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22THE SOFTWARE.
23-->
24
25<!--
26
27-->
28<?jelly escape-by-default='true'?>
29<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">
30  <st:documentation>
31    See
32    http://wiki.hudson-ci.org/display/HUDSON/Jelly+form+controls
33    for the reference.
34
35    <st:attribute name="method" use="required">
36      Server-side method that handles the validation. For example, if this is 'foo', you need "doFoo" on
37      your descriptor class.
38    </st:attribute>
39    <st:attribute name="title" use="required">
40      Caption of the validate button. Should be internationalized.
41    </st:attribute>
42    <st:attribute name="progress">
43      Caption of the text shown while the AJAX call is in progress. For example, "checking..."
44    </st:attribute>
45    <st:attribute name="with">
46      ','-separated list of fields that are sent to the server.
47    </st:attribute>
48    <st:attribute name="checkUrl">
49      User-defined url for AJAX request. Default value is ${rootURL}/descriptor/${descriptor.clazz.name}
50    </st:attribute>
51    <st:attribute name="queryParams">
52      Additional query params for AJAX request
53    </st:attribute>
54  </st:documentation>
55  <f:nested>
56    <div style="float:right">
57      <input type="button" value="${title}" class="yui-button"
58             onclick="validateButton('${checkUrl!=null? checkUrl : rootURL+'/descriptor/'+descriptor.clazz.name}/${method}${queryParams!=null? '?'+queryParams : ''}','${with}',this)" />
59    </div>
60    <div style="display:none;">
61      <img src="${imagesURL}/spinner.gif" /> ${attrs.progress}
62    </div>
63    <div><!-- this is where the error message goes --></div>
64  </f:nested>
65</j:jelly>