sourceforge > tacos
 

AjaxSubmit

Used almost exactly the same way that normal tapestry Submit components, with the added functionality of using standard tacos ajax interactions.

Note
The parameters of the standard Submit component have been purposefully left out, for those please see the referenced tapestry documentation. This section only outlines the enhancements and new parameters added in by tacos.

See also: Submit , Live Demo

Parameters

Name Type Direction Required Default Description
updateComponents List (or comma-delimited String) in no   List of component id strings to refresh after invoking listener. This causes the contents of any html element on the page with a matching id in this list to be replaced, if the specified element is rendered in the return response.
effects String in no   Specifies a list of effects to be applied to the returned response. Read the Effects-Popups page of the UserGuide for more details.
preEffects String in no   The same with effects parameter, but specifies effects that should be performed on parts before triggering the ajax request. Read the Effects-Popups page of the UserGuide for more details.
popup String in no  

If specified, the updated content will be shown in a floating pane. Read the Effects-Popups page of the UserGuide for more details.

updateObject String in no   If specified, the string passed in will be used to build a javascript statement which will call updateObject.ajaxUpdate(element, responseElement, elementId) / updateObject.beforeAjaxUpdate(responseElements) / updateObject.responseComplete(responseElements)
statusElement String in no   If specified, the html element on your page with a matching id to this parameter will be temporarily displayed for a few seconds with status text set on the AjaxWebRequest via addStatusResponse(String).
focusElement String in no   If specified, the html element on your page to focus after the ajax request.
backLink String in no   Provides ability to have the action encapsulated by the specified AjaxDirectLink used when users hit back button on browser in form.
forwardLink String in no   Provides ability to have the action encapsulated by the specified AjaxDirectLink used when users hits forward button on browser AFTER hitting back button provided in backLink first.
submitNormal boolean in no false Some instances require that the submission of forms caused by this component go through normal submits, not using async IO operations. Setting this to true will cause the form to be submitted in a non-ajax way.
onClick String in no If specified, this javascript will be called before the ajax submit. It can be used for confirmation messages: "if (!confirm('Are you sure?')) { return false; }"

Body: rendered

Informal parameters: allowed

Reserved parameters: href, name

Examples

This example uses the AjaxSubmit to submit the input username entry on a login form.

HTML template

          
<form jwcid="loginForm">
 <fieldset>
  <legend>Login</legend>

  <span jwcid="@FieldLabel" field="component:username" />
  <input jwcid="username@TextField"
         value="ognl:userName" displayName="message:username.input" />

  <input jwcid="@tacos:AjaxSubmit" updateComponents="nameDisplay" value="Submit"     
     effects="{highlight:{any:'[255,255,184], 500, 500'}}"/>

</form>

<div jwcid="nameDisplay@Any" id="nameDisplay">
   <span jwcid="@If" condition="ognl:userName" >
      You entered <span jwcid="@Insert" value="ognl:userName" />.
   </span>
</div>
        
        

Page specification

          
<property name="userName" persist="session" />

<component id="loginForm" type="tacos:AjaxForm" >
  <binding name="updateComponents" value="ognl:{'loginForm'}" />
  <binding name="listener" value="listener:userLogin" />
</component>
          
        

Java sources

          
public abstract class UserLogin extends BasePage {

  /**
   * Invoked by forms listener:userLogin specification.
   */
  public void userLogin(IRequestCycle cycle) {
   //don't need to do anything, input values are already set
  }
}