Skip to content

Instantly share code, notes, and snippets.

@erickedji
Created April 7, 2009 18:11
Show Gist options
  • Save erickedji/91367 to your computer and use it in GitHub Desktop.
Save erickedji/91367 to your computer and use it in GitHub Desktop.
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ page import="com.liferay.portal.kernel.portlet.LiferayWindowState" %>
<div id="<portlet:namespace />soaPortletDiv">
<form
action="<portlet:actionURL/>"
method="post"
name="<portlet:namespace />fm"
id="<portlet:namespace />fm">
<textarea name="<portlet:namespace />msg" id="<portlet:namespace />msg"></textarea>
<input type="submit" name="<portlet:namespace />sm" value="SOS!" />
</form>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
var <portlet:namespace/>form = jQuery('#'+'<portlet:namespace />fm');
<portlet:namespace/>form.bind("submit",function(event){
event.preventDefault();
var inputs = jQuery("textarea", <portlet:namespace/>form);
var url = '<portlet:actionURL windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>"/>' + "&" + inputs.serialize(); // see note below
jQuery('#<portlet:namespace />soaPortletDiv').load(url);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment