Jelly form controls

Jelly form controls

Building Tag Library Documentation


Most of the the jelly files in the Hudson source have embedded documentation .

Validation Button

This tag creates a right-aligned button for performing server-side validation. It is suitable for situations where the validation depends on the values of multiple input fields, such as credential check that uses both username and password.

Jelly code Example


<f:entry title="${%Access Key ID}" help="...">
  <f:textbox field="accessId" />
</f:entry>
<f:entry title="${%Secret Access Key}" help="...">
  <f:password field="secretKey" />
</f:entry>
<f:validateButton
   title="${%Test Connection}" progress="${%Testing...}"
   method="testConnection" with="secretKey,accessId" />



























The title attribute is used to determine the text written on the button. The progress attribute determines the message displayed while the server-side validation is in progress. The method attribute specifies the server-side method invoked by this button; this follows the stapler name mangling convention, so for example method="testConnection" will invoke the doTestConnection method. This method needs to be on the Descriptor class that owns this form fragment.

Finally, the with attribute specifies the input fields sent to the server for the validation. They are matched against the field attribute or the name attribute of other input controls. The values of the nearest input fields above the <f:validateButton/> are sent to the server, so this means the button has to come after the input fields. Multiple fields can be specified by using ','.

On the server side, this tag invokes the standard "check"-style method like this:

public void doTestConnection(StaplerRequest req, StaplerResponse rsp,
    @QueryParameter("accessId") final String accessId, @QueryParameter("secretKey") final String secretKey) throws IOException, ServletException {
    new FormFieldValidator(req,rsp,true) {
        protected void check() throws IOException, ServletException {
            try {
                ... do some tests ...
                ok("Success");
            } catch (EC2Exception e) {
                error("Client error : "+e.getMessage());
            }
        }
    }.process();
}

The check method contains the validation logic. In the end, this method has to call either ok, warning, or error method. Depending on which method you use, the appropriate HTML will be rendered on the client side to indicate the status to the user.

Advanced

Expandable section that shows "advanced..." button by default. Upon clicking it, a section unfolds.

Optional attributes:
  • help (optional) If present, URL of the help HTML page.
Jelly code Example


<f:section title="Advanced Project Options">
  <f:advanced>
    <p:config-quietPeriod />
    <st:include page="configure-advanced.jelly" optional="true" />
  </f:advanced>
</f:section>














At start only button is shown:

When the button is clicked it disappears, and the content is displayed instead













OptionalBlock

Foldable block expanded when the menu item is checked.

Mandatory attributes:
  • name Name of the checkbox.
  • title Human readable text that follows the checkbox
  • checked Initial checkbox status. true/false.
Optional attributes:
  • help (optional) If present, URL of the help HTML page.
Jelly code Example


<f:block>
  <table>
    <f:optionalBlock name="dynamic" title="Use existing dynamic view">
      <f:entry title="View drive">
        <f:textbox name="drive" value="${it.drive}"/>
      </f:entry>
    </f:optionalBlock>
  </table>
</f:block>














Unchecked the text box will not be displayed:

Checked the text box is displayed













Select (drop-down menu)

Use an <f:entry> tag to enclose the normal select tag.

Jelly code Example


<f:entry name="goalType" title="Choose Goal Type" field="goalType">
            <select name="goalType">
                <option value="buildGoal">Build Goal</option>
                <option value="findBugsGoal">FindBugs goal</option>
            </select>
        </f:entry> 






















Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Nov 04, 2008

    sreekanth says:

    Hi , Can any one point  me location where I can find documentation for jell...

    Hi , Can any one point  me location where I can find documentation for jelly form tags?

    Thanks,

    Sreekanth

  2. Nov 28, 2008

    johnlon says:

    Is there a user guide anywhere fo the jelly markup

    Is there a user guide anywhere fo the jelly markup

  3. Apr 29, 2009

    Alan Harder says:

    In the Additional references section of Extend Hudson you'll find links to core ...

    In the Additional references section of Extend Hudson you'll find links to core Jelly tag documentation.
    For Hudson specific tags, look in the source files.. most have some documentation (for example, look under lib/form from that link to find the form tags).

  4. Sep 11, 2009

    benjamin shine says:

    Great page! Thank you!

    Great page! Thank you!

  5. Nov 17, 2009

    jeremie tatibouet says:

    Hi everyone, "This method needs to be on the Descriptor class that owns this fo...

    Hi everyone,

    "This method needs to be on the Descriptor class that owns this form fragment."

    My question is the following:

    How do you know which Descriptor owns the form fragment ?

    Thank you.

  6. Jun 30, 2010

    Payal Patel says:

    Any comments on how do we handle dynamic layout using jelly? Like handling even...

    Any comments on how do we handle dynamic layout using jelly?

    Like handling event on select drop-down menu?

  7. Apr 04, 2011

    Andre Silva says:

    How do you tell the descriptor the state of the optional block (active/inactive ...

    How do you tell the descriptor the state of the optional block (active/inactive or shown/hidden)?

  8. Jul 21, 2011

    guowei says:

    Hi,everyone "This method needs to be on the Descriptor class that owns this for...

    Hi,everyone

    "This method needs to be on the Descriptor class that owns this form fragment."

    Who can help explain some of this,thanks!!!

    1. Jul 22, 2011

      Winston Prakash says:

      I'm writing an article on "How to write a plugin for Hudson" in which I'll expla...

      I'm writing an article on "How to write a plugin for Hudson" in which I'll explain all these. In short a plugin extends an Extension Point. If your extension point need to provide UI for configuration, then it need to be Describable Object. A Descriptor Object is the one describing the Describable Object. Any validation method need to be in the Descriptor Object.