webwork / src / java / template / ajax / submit-ajax.ftl

<#--
<tr>
    <td colspan="2"><div <#rt/>
-->
<#include "/${parameters.templateDir}/${themeProperties.parent}/controlheader.ftl" />
<#--
	If we don't have the followings :-
	  - parameters.name
	  - parameters.id
	  - parameters.form.id
	 there's insufficient info for us to do a bind that knows which method in the action to execute.
-->
<#if parameters.name?exists && parameters.id?exists && parameters.form.id?exists>
<script type="text/javascript">
	function doBeforeBind_${parameters.id}() {
		// remove the hidden input field if one exists, cause we only can click on one button and that button's name should 
		// be the name of the hidden input
	    if (document.getElementById('hidden_action')) { 
			document.getElementById('${parameters.form.id}').removeChild(document.getElementById('hidden_action'));
		}
		var inputElement = document.createElement("input");
		inputElement.setAttribute("id", "hidden_action");
		inputElement.setAttribute("type", "hidden");
		inputElement.setAttribute("name", "${parameters.name?html}");
		inputElement.setAttribute("value", "");
		document.getElementById('${parameters.form.id}').appendChild(inputElement);
	};
    dojo.addOnLoad(function() {
    	dojo.event.connect(
    		dojo.widget.byId('${parameters.id}'),
    		"beforeBind",
    		"doBeforeBind_${parameters.id}"
    	);
    });
</script>
</#if>
<button type="submit" dojoType="webwork:BindButton"<#rt/>
<#if parameters.id?exists>
 id="${parameters.id}"<#rt/>
</#if>
<#if parameters.form?exists && parameters.form.id?exists>
 formId="${parameters.form.id}"<#rt/>
</#if>
<#if parameters.name?exists>
 name="${parameters.name?html}"<#rt/>
</#if>
<#if parameters.nameValue?exists>
 value="<@ww.property value="parameters.nameValue"/>"<#rt/>
</#if>
<#if parameters.cssClass?exists>
 class="${parameters.cssClass?html}"<#rt/>
</#if>
<#if parameters.cssStyle?exists>
 style="${parameters.cssStyle?html}"<#rt/>
</#if>
<#if parameters.resultDivId?exists>
 targetDiv="${parameters.resultDivId}"<#rt/>
</#if>
<#if parameters.onLoadJS?exists>
 onLoad="${parameters.onLoadJS}"<#rt/>
</#if>
<#if parameters.preInvokeJS?exists>
 preInvokeJS="${parameters.preInvokeJS}"<#rt/>
</#if>
<#if parameters.notifyTopics?exists>
 notifyTopics="${parameters.notifyTopics}"<#rt/>
</#if>
<#if parameters.listenTopics?exists>
 listenTopics="${parameters.listenTopics}"<#rt/>
</#if>
<#include "/${parameters.templateDir}/simple/scripting-events.ftl"/>
><#if parameters.nameValue?exists><@ww.property value="parameters.nameValue"/><#rt/></#if></button>
<#--include "/${parameters.templateDir}/xhtml/controlfooter.ftl" /-->
<#include "/${parameters.templateDir}/${themeProperties.parent}/controlfooter.ftl" />
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.