Jelly form controlsBuilding Tag Library DocumentationMost of the the jelly files in the Hudson source have embedded documentation. Unfortunately, this documentation is not currently published on the web. You can generate your own easily! First, get a hudson build going, following these directions. Then run "mvn site" which will generate the jelly tag library documentation in hudson/main/core/target/site/jelly-taglib-ref.html (on disk). If you are trying to understand Hudson's jelly-isms, this document will help a lot. Validation ButtonThis 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.
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. AdvancedExpandable section that shows "advanced..." button by default. Upon clicking it, a section unfolds. Optional attributes:
OptionalBlockFoldable block expanded when the menu item is checked. Mandatory attributes:
Optional attributes:
Select (drop-down menu)Use an <f:entry> tag to enclose the normal select tag.
|


Comments (9)
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
Nov 28, 2008
johnlon says:
Is there a user guide anywhere fo the jelly markupIs there a user guide anywhere fo the jelly markup
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).
Sep 11, 2009
benjamin shine says:
Great page! Thank you!Great page! Thank you!
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.
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?
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)?
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!!!
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.