掲示板
TypeError: b.one is not a function
9年前 に Atif Hussain によって更新されました。
TypeError: b.one is not a function
Junior Member 投稿: 47 参加年月日: 12/04/03 最新の投稿
Hi, I am unable to fix this issue. I am unable to call action method, using Alloy UI IO.
Following is the piece of code.
The java side is :
But I am unable to call backend, see FireFox snapshot.
Following is the piece of code.
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%>
<portlet:defineobjects />
<%
String name = StringPool.BLANK;
String email = StringPool.BLANK;
String phone = StringPool.BLANK;
String pass = StringPool.BLANK;
String cpass = StringPool.BLANK;
%>
<portlet:actionurl name="signup" var="signup_url">
</portlet:actionurl>
<form id="myForm" method="post">
<div class="container-fluid">
<div class="row-fluid">
<fieldset>
<legend>Signup</legend>
<div class="span5">
<div class="control-group">
<label class="control-label" for="name">Name:</label>
<div class="controls">
<input name="<portlet:namespace />name" id="name" type="text" value="<%=name%>" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">E-mail:</label>
<div class="controls">
<input name="<portlet:namespace />email" id="email" type="text" value="<%=email%>">
</div>
</div>
<div class="control-group">
<label class="control-label" for="phone">Phone Number:</label>
<div class="controls">
<input name="<portlet:namespace />phone" id="phone" type="text" value="<%=phone%>" required>
</div>
</div>
</div>
<div class="span5">
<div class="control-group">
<label class="control-label" for="password">Password:</label>
<div class="controls">
<input name="<portlet:namespace />password" id="password" type="password" value="<%=cpass%>" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="confirm_password">Confirm
Password:</label>
<div class="controls">
<input name="<portlet:namespace />confirm_password" id="confirm_password" type="password" value="<%=cpass%>" required>
</div>
</div>
<input class="btn btn-info" id="signup" type="submit" value="Signup">
</div>
</fieldset>
</div>
</div>
</form>
<script type="text/javascript">
YUI().use('aui-node, aui-io-request', function(Y) {
var myForm = Y.one('#myForm');
myForm.on('submit',
function() {
Y.io.request('<%=signup_url.toString()%>', {
success : function() {
var data = this.get('responseData');
alert(data);
},
error : function() {
alert("Error");
}
});
});
});
</script>
The java side is :
public class SignupAction extends MVCPortlet {
public void signup(ActionRequest actionRequest,
ActionResponse actionResponse) throws IOException, PortletException {
System.out.println("Hello");
}
}
But I am unable to call backend, see FireFox snapshot.
添付ファイル:
9年前 に David H Nebinger によって更新されました。
RE: TypeError: b.one is not a function
Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Jeez, what a mess. I would recommend getting a copy of Liferay in Action to see how AUI/JSP portlets are supposed to be written.