Akdora’s Blog

Programming, Oracle, Life, Fun

How to use Ext.Ajax.request with Response Text? February 6, 2009

If we want to query something via ajax and show a response on the screen, we can use Ext.Ajax.request class of ExtJS. It provides a simple way to make Ajax requests with maximum flexibility. We will set the action url and get a response from action. Then, we will show the response on the screen. Let’s do it.

Firstly, I am writing the JSP page:

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<link rel="stylesheet" type="text/css" href="/xx/resources/extjs/css/ext-all.css">
<script type="text/javascript" src="/xx/resources/extjs/ext-base.js"></script>
<script type="text/javascript" src="/xx/resources/extjs/ext-all-debug.js"></script>
<script type="text/javascript">
Ext.onReady(function() {

 function fn_AKExt( message, title ){
   Ext.Msg.show({
      title: title,
      msg: message ,
      buttons: Ext.MessageBox.OK,
      icon: Ext.MessageBox.INFO
     });
 } (more...)