javascript函数的合金用户界面问题

javascript函数的合金用户界面问题,javascript,jsp,liferay,portlet,alloy-ui,Javascript,Jsp,Liferay,Portlet,Alloy Ui,我试图从表单中的按钮元素调用js函数,这是我的代码: <% PortletPreferences prefs = renderRequest.getPreferences(); String employee = (String)prefs.getValue("name", "New Employee"); %> <portlet:actionURL var="callURL" windowState="<%=LiferayWindowState.EXCLUSI

我试图从表单中的按钮元素调用js函数,这是我的代码:

<% 
PortletPreferences prefs = renderRequest.getPreferences(); 
String employee = (String)prefs.getValue("name", "New Employee");  
%>

<portlet:actionURL var="callURL" windowState="<%=LiferayWindowState.EXCLUSIVE.toString() %>" />

<script type="text/javascript"> 
    Liferay.provide(window, 'insertEmployee',
    function () 
        {
            var A = AUI();
            var url = 'http://localhost:8080/c/portal/json_Service';
            A.io.request(url,
                {
                    method:'POST',
                    data:
                    {
                        serviceClassName:   'com.liferay.test.service.TrabajadorServiceUtil',
                        serviceMethodName:  'create',
                        servletContextName: 'TrabajadorPlugin-portlet',
                        serviceParameters:  '[param]',
                    },
                    headers: {'Content-Type':'charset=utf-8'},
                    on:
                    {
                        success: function()
                        {
                            alert("success " + responseData.name);
                        }
                    },
                    form: {id: 'postForm'},
                    xdr: {dataType: 'json'}
                });
        },
        ['aui-io']
    );
</script>

<div>
    <aui:form name="postForm" id="postForm" method="post" onSubmit="insertEmployee();">
        <input type="text" name="param" value="<%=employee %>"/>
        <input type="submit" value="Submit"/>
    </aui:form>
</div>

Liferay.provide(窗口“insertEmployee”,
函数()
{
var A=AUI();
var url='1〕http://localhost:8080/c/portal/json_Service';
A.io.请求(url,
{
方法:'POST',
数据:
{
serviceClassName:'com.liferay.test.service.TrabajadorServiceUtil',
serviceMethodName:“创建”,
servletContextName:'TrabajadorPluginPortlet',
serviceParameters:“[param]”,
},
标题:{'Content-Type':'charset=utf-8'},
关于:
{
成功:函数()
{
警报(“成功”+响应数据名称);
}
},
表单:{id:'postForm'},
xdr:{dataType:'json'}
});
},
['aui-io']
);
我没有使用java类,因此我也没有使用portlet:actionURL

我的意图是在单击“提交”按钮时调用“insertEmployee()”,但它只发送用户在文本字段中插入的参数。我尝试将“onsubmit”也放在提交输入中,但给出了相同的结果

若你们能帮助我或指导我解决这个问题,那个就太好了!我在网上找不到好的信息,也不知道问题出在哪里,或者我还需要知道什么

提前多谢

我只需要:

<aui:script>
window.functionName = function ()  
{
//code
};
</aui:script>

window.functionName=函数()
{
//代码
};
并从以下地址调用:

<aui:form name="myform" action="javascript:functionName();">
<aui:input type="submit" name="Submit" value="Update"/>
</aui:form>


该函数是从表单标签调用的。

我想问题出在,但我尝试了我头脑中的一切。。。请帮忙!!!