Java Enterprise Turbine
JET Documentation
(If you feel that the documentation is too short, please create a bug report)
^3 Forms
^3.1 Defining forms
The form definition follows the rules defined in the DTD http://jet.sourceforge.net/dtds/jet_beta2.dtd. You will find the corresponding dtd provided in the jet.jar.

<JetConfig
project-name="testconfig"
>

  
<JetForm
id="testform" action="/test2.jet"
>

    
<JetGridPanel
id="logingrid" cols="2"
>

      
<JetLabel
id="lbllogin"
>

        
<set
name="content" value="login:"
/>

      
</JetLabel>

      
<JetInput
id="login"
/>


      
<JetLabel
id="lblpassword"
>

      
<set
name="content" value="password:"
/>

      
</JetLabel>

      
<JetInput
id="password"
>

        
<set
name="inputtype" value="password"
/>

      
</JetInput>

      
<JetSubmit
id="go"
/>

    
</JetGridPanel>

  
</JetForm>


^3.2 Form elements
Here I describe the built in html elements. If you need other elements or elements with different behave/rendering you can write your own by extending in jet.html.internal.JetInputComponent, jet.html.internal.JetOutputComponent or one of the existing elements like done by the jet.html.JetRadioButton.

On each element you can define event,validate or set methods in the xml config with the corresponding xml tags. On the grid elements you can also specify ref tags to refer to already defined tags for reuse. Which tags can be used on which element, please see below:

JetButton
    
<event
type="onMouseOver..." call="javascript:testFunction(this);"
/>
<validate
type="client or server" rule="minlength..."
/>
<set
name="value" value=""
/>
<set
name="label" value=""
/>
<set
name="messageKey" value=""
/>
<set
name="buttonType" value=""
/>
JetCheckBox
<event
type="onMouseOver..." call="javascript:testFunction(this);"
/>
<validate
type="client or server" rule="minlength..."
/>
<set
name="value" value=""
/>
<set
name="defaultchecked" value=""
/>
JetDisplayMessage
<set
name="refid" value=""
/>
JetFieldset cols="2"
<ref
name="id" value=""
/>
JetFile
<set
name="messageKey" value=""
/>
JetForm action="" method="POST" extend="formid"
<ref
name="id" value=""
/>
<set
name="enctype" value=""
/>
JetGridPanel cols="1"
<ref
name="id" value=""
/>
JetGridPanel2 cols="3"
<ref
name="id" value=""
/>
JetImage
<set
name="urlKey" value=""
/>
<set
name="altKey" value=""
/>
JetInput
<event
type="onMouseOver..." call="javascript:testFunction(this);"
/>
<validate
type="client or server" rule="minlength..."
/>
<set
name="value" value=""
/>
<set
name="inputtype" value=""
/>
JetLabel
<set
name="messageKey" value=""
/>
<set
name="content" value=""
/>
JetOption
<set
name="key" value=""
/>
<set
name="value" value=""
/>
<set
name="defaultselected" value=""
/>
JetOutput
<set
name="messageKey" value=""
/>
<set
name="content" value=""
/>
JetRadiobutton
<event
type="onMouseOver..." call="javascript:testFunction(this);"
/>
<validate
type="client or server" rule="minlength..."
/>
<set
name="value" value=""
/>
JetSelection
<event
type="onMouseOver..." call="javascript:testFunction(this);"
/>
<validate
type="client or server" rule="minlength..."
/>
<set
name="multiple" value=""
/>
JetTextArea
<event
type="onMouseOver..." call="javascript:testFunction(this);"
/>
<validate
type="client or server" rule="minlength..."
/>
<set
name="value" value=""
/>

The event support is just implemented to show that it is possible to implement it and for quick usage - but it is deprecated or let me say "DO NOT USE IF POSSIBLE". Use CSS to do javascript events like onMouseOver.