Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Pankaj Kathiriya
RE: onclick event, i need to get the records from database
July 18, 2013 2:22 AM
Answer

Pankaj Kathiriya

Rank: Liferay Master

Posts: 645

Join Date: August 4, 2010

Recent Posts

You can make use of ajax calls on Travel To and Travel From text-fields on-blur event.
Ajax calls would do lookup in your database tables and if it finds match , it will return required fields back which you can populate to other text fields.
Akram MONCER
RE: onclick event, i need to get the records from database
July 18, 2013 2:23 AM
Answer

Akram MONCER

Rank: Regular Member

Posts: 106

Join Date: September 25, 2012

Recent Posts

hi
u want to fell the Landmark and Total Km if exist in the database after the user add the from, to input without submitting the form right?
think about using jQuery, and ajax to make call to the server without submitting the form
anand gopalan
RE: onclick event, i need to get the records from database
July 18, 2013 2:45 AM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hi Pankaj/Akram,

u want to fell the Landmark and Total Km if exist in the database after the user add the from, to input without submitting the form right?


Exactly Akram.
I have to use only Ajax or I have to use both Ajax and jQuery. Please tell me.
Akram MONCER
RE: onclick event, i need to get the records from database
July 18, 2013 2:51 AM
Answer

Akram MONCER

Rank: Regular Member

Posts: 106

Join Date: September 25, 2012

Recent Posts

Ajax is to make call to the server without submit form, and u will need to use other jQuery method to detect when exactly make the call(after the user fell the needed information)
anand gopalan
RE: onclick event, i need to get the records from database
July 18, 2013 9:57 PM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hi Akram,

if possible can you please send the any sample code, and I am new to AJAX and JQUERY.
anand gopalan
RE: onclick event, i need to get the records from database
July 19, 2013 2:20 AM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hello Pankaj,

Do you know how to write ajax & jquery for travel from and travel to and get the records from the database in onblur method..

I stuck up into implement into my code view.jsp.

Regards
Anand
Attachments: view.jsp (10.6k)
anand gopalan
RE: onclick event, i need to get the records from database
July 21, 2013 10:52 PM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hi,

Anybody know how to implement Ajax calls would do lookup in our database tables and if it finds match ,
it will return required fields back which you can populate to other text fields.
Samita Bhujbal
RE: onclick event, i need to get the records from database
July 21, 2013 11:13 PM
Answer

Samita Bhujbal

Rank: Regular Member

Posts: 120

Join Date: July 5, 2011

Recent Posts

Hey anand you may use following code to make ajax call through Jquery :- In mY case on selection of payInSlip Type from dropdown (id=payinslipid ) , three textboxes with id (bankNameid,branchNameid,accountNumberid) gets poplulated with respective value .
In JSP file :- Write following code

$(document).ready(function(){
$("#payinslipid").change(function()
{
var payinslipid = $("#payinslipid").val();
var dataString4 = 'function=BankDetails'+'&payinslipid='+ payinslipid;
if(payinslipid!=0)
{
$.ajax({

url: "<liferay-portlet:resourceURL></liferay-portlet:resourceURL>",
data: dataString4,
cache: false,
success: function(html)
{
var straaray= html.split("/");
$("#bankNameid").val(straaray[0]);
$("#branchNameid").val(straaray[1]);
$("#accountNumberid").val(straaray[2]);
}
}); return false;
}else
{
$("#bankNameid").val("");
$("#branchNameid").val("");
$("#accountNumberid").val("");

}
});

});

In Action file :-
public void serveResource(ResourceRequest resourceRequest,
ResourceResponse resourceResponse) throws IOException,
PortletException {

String fcName = resourceRequest.getParameter("function");

if(fcName != null ){
if(fcName.equals("BankDetails"))
{ try {
GetBankDetails(resourceRequest, resourceResponse);
} catch (SystemException e) {

e.printStackTrace();
}
}

}
}

public void GetBankDetails(ResourceRequest request, ResourceResponse response) throws SystemException {

String payinslipid=ParamUtil.getString(request, "payinslipid");
String bankname,branchname,accno,buffer;
System.out.println("payinslipid in function============"+payinslipid);
PayInSlipMaster paymaster= new PayInSlipMasterImpl();
CSIBankDetails csi = new CSIBankDetailsImpl();
try {
paymaster= PayInSlipMasterLocalServiceUtil.GetById(Integer.valueOf(payinslipid));

int bankid= paymaster.getBankID();
csi = CSIBankDetailsLocalServiceUtil.FindByBankid(bankid);
bankname = csi.getBankName();
branchname= csi.getBranchName();
accno = csi.getCSIAccountNumber();
buffer= bankname+"/"+branchname+"/"+accno;
try {
response.getWriter().println(buffer);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (NoSuchModelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
anand gopalan
RE: onclick event, i need to get the records from database
July 21, 2013 11:34 PM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hello Samitha,

Thank you for your code, I will try to implement.
anand gopalan
RE: onclick event, i need to get the records from database
July 22, 2013 11:32 PM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hi,

I have written code like below and now I want to know how to get the value in view.jsp

view.jsp

function onblur(){

// document.getElementsByName("t02Travelto").value.length !=0;

$(document).ready(function(){
$("#t02Travelfrom").change(function()
{
var t02Travelfrom = $("#t02Travelfrom").val();
var t02Travelto=$("#t02Travelto").val();
var dataString = 'function=TravelDetails'+'&t02Travelfrom='+ t02Travelfrom+'&t02Travelto='+ t02Travelto;

if(t02Travelfrom!=0 && t02Travelto!=0)
{
$.ajax({

url: "<liferay-portlet:resourceURL></liferay-portlet:resourceURL>",
data: dataString,
cache: false,
success: function(html)
{
var straaray= html.split("/");
$("#t02Landmark").val(straaray[0]);
$("#t02Totalkm").val(straaray[1]);

}
}); return false;
}else
{
$("#t02Landmark").val("");
$("#t02Totalkm").val("");


}
});

});
}


TraveDetails.java

// Handle Ajax call

public void serveResource(ResourceRequest resourceRequest,ResourceResponse resourceResponse)
throws IOException, PortletException {

System.out.println("********inside serveResource()********");
String fcName = resourceRequest.getParameter("function");

if(fcName != null ){
if(fcName.equals("TravelDetails"))
{ try {
GetTravelDetails(resourceRequest, resourceResponse);
} catch (SystemException e) {

e.printStackTrace();
}
}

}
}

public void GetTravelDetails(ResourceRequest request, ResourceResponse response) throws SystemException {

System.out.println("********inside GetTravelDetails()********");
String tfrom =request.getParameter("t02Travelfrom");
String tto = request.getParameter("t02Travelto");

ActionRequest actionRequest = null;
String t02Travelfrom=ParamUtil.getString(actionRequest, "t02Travelfrom");
String t02Travelto=ParamUtil.getString(actionRequest, "t02Travelto");

String t02Landmark = ParamUtil.getString(actionRequest, "t02Landmark");
String t02Totalkm = ParamUtil.getString(actionRequest, "t02Totalkm");

String buffer;
System.out.println("t02Travelfrom in function---------->"+t02Travelfrom);
System.out.println("t02Travelto in function------------>"+t02Travelto);

if(tfrom.equals(t02Travelfrom) && tto.equals(t02Travelto)){

System.out.println("inside if condition");
buffer= t02Landmark +"/" + t02Totalkm ;
System.out.println("buffer values are----->"+buffer);
try {
response.getWriter().println(buffer);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

}
anand gopalan
RE: onclick event, i need to get the records from database
July 23, 2013 2:02 AM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hi Samitha,

In view.jsp I modify below code

<aui:input name="t02Landmark" type="text" label="" maxlength="15" value="" onclick="getData()">

//Ajax

function getData(){

// document.getElementsByName("t02Travelto").value.length !=0;
alert("calling ajax method getData()");---------------> after this line, it is not going inside.
$(document).ready(function(){
alert("1");
$("#t02Travelfrom").change(function()
{
var t02Travelfrom = $("#t02Travelfrom").val();
var t02Travelto=$("#t02Travelto").val();
var dataString4 = 'function=TravelDetails'+'&t02Travelfrom='+ t02Travelfrom+'&t02Travelto='+ t02Travelto;

if(t02Travelfrom!=0 && t02Travelto!=0)
{
$.ajax({

url: "<liferay-portlet:resourceURL></liferay-portlet:resourceURL>",
data: dataString4,
cache: false,
success: function(html)
{
var straaray= html.split("/");
$("#t02Landmark").val(straaray[0]);
$("#t02Totalkm").val(straaray[1]);
alert("value of straaray[0]"+$("#t02Landmark").val(straaray[0]));
}
}); return false;
}else
{
$("#t02Landmark").val("");
$("#t02Totalkm").val("");

alert("value of "+$("#t02Landmark").val(""));
alert("value of "+$("#t02Totalkm").val(""));
}
});

});
}
anand gopalan
RE: onclick event, i need to get the records from database
July 23, 2013 3:43 AM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hi,

Anybody know why Action class is not calling?
Ahmed Hasan
RE: onclick event, i need to get the records from database
July 23, 2013 5:02 AM
Answer

Ahmed Hasan

Rank: Expert

Posts: 303

Join Date: April 13, 2007

Recent Posts

Hi Everybody,

The best thing in such scenarios is to generate JSON services out of Liferay's service builder and invoke it directly thorough simple JavaScript in your HTML. It will work like charm instead of making a "serveResource" request to the portlet and trying to invoke it through jQuery Ajax. The steps and details are given in a comprehensive fashion in chapter 8 of my FREE eBook, Liferay Portlet Cookbook. You can download a free copy of the book from http://www.mpowerglobal.com/download-cookbook and go through chapter 8.

Thank you so much.
Tejas patel
RE: onclick event, i need to get the records from database
July 23, 2013 6:45 AM
Answer

Tejas patel

Rank: Junior Member

Posts: 71

Join Date: January 23, 2012

Recent Posts

Here is the example of auto complete text field may it helps you.
anand gopalan
RE: onclick event, i need to get the records from database
July 24, 2013 2:18 AM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hi

i am using ajax call to get the records from the database

i have 4 text fields
1. t02Travelfrom
2. t02Travelto

when user fill the data and it match i should get the records from the database and display into the below fields.

t02Landmark
t02Totalkm

i have written the code,when click the t02Landmark, but code is not execute after

$("#t02Landmark").click(function()
{


Anybody know why is not execute. Please answer.

//Ajax call.
function getData(){

// document.getElementsByName("t02Travelto").value.length !=0;
alert("calling ajax method getData()");
//alert(html);
$(document).ready(function(){
alert("1");
$("#t02Landmark").click(function()
{

alert("2");
var t02Travelfrom = $("#t02Travelfrom").val();
var t02Travelto=$("#t02Travelto").val();
var dataString4 = 'function=GetTravelDetails'+'&t02Travelfrom='+ t02Travelfrom+'&t02Travelto='+ t02Travelto;
alert("after dataString4");
if(t02Travelfrom!=0 && t02Travelto!=0)
{
$.ajax({

url: "<liferay-portlet:resourceURL></liferay-portlet:resourceURL>",
data: dataString4,
cache: false,
success: function(html)
{
var straaray= html.split("/");
$("#t02Landmark").val(straaray[0]);
$("#t02Totalkm").val(straaray[1]);
alert("value of straaray[0]"+$("#t02Landmark").val(straaray[0]));
}
}); return false;
}else
{
$("#t02Landmark").val("");
$("#t02Totalkm").val("");

alert("value of "+$("#t02Landmark").val(""));
alert("value of "+$("#t02Totalkm").val(""));
}
});

});
}
M J
RE: onclick event, i need to get the records from database
July 24, 2013 6:50 AM
Answer

M J

Rank: Regular Member

Posts: 179

Join Date: March 1, 2013

Recent Posts

Try this:

In view.jsp, add this before the javascript:


<portlet:resourceURL var="getTravelDetailsUrl">
<portlet:param name="<%=Constants.CMD%>" value="2" />
</portlet:resourceURL>


then replace

url: "<liferay-portlet:resourceURL></liferay-portlet:resourceURL>",

with

url: "${getTravelDetailsUrl}",

In TraveDetails.java, replace serveResource method with the following:


@Override
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, PortletException {
String cmd = ParamUtil.getString(resourceRequest, Constants.CMD);
if (cmd.equals("2")) {
GetTravelDetails(resourceRequest, resourceResponse);
}
}


MJ



anand gopalan:
Hi Samitha,

In view.jsp I modify below code

<aui:input name="t02Landmark" type="text" label="" maxlength="15" value="" onclick="getData()">

//Ajax

function getData(){

// document.getElementsByName("t02Travelto").value.length !=0;
alert("calling ajax method getData()");---------------> after this line, it is not going inside.
$(document).ready(function(){
alert("1");
$("#t02Travelfrom").change(function()
{
var t02Travelfrom = $("#t02Travelfrom").val();
var t02Travelto=$("#t02Travelto").val();
var dataString4 = 'function=TravelDetails'+'&t02Travelfrom='+ t02Travelfrom+'&t02Travelto='+ t02Travelto;

if(t02Travelfrom!=0 && t02Travelto!=0)
{
$.ajax({

url: "<liferay-portlet:resourceURL></liferay-portlet:resourceURL>",
data: dataString4,
cache: false,
success: function(html)
{
var straaray= html.split("/");
$("#t02Landmark").val(straaray[0]);
$("#t02Totalkm").val(straaray[1]);
alert("value of straaray[0]"+$("#t02Landmark").val(straaray[0]));
}
}); return false;
}else
{
$("#t02Landmark").val("");
$("#t02Totalkm").val("");

alert("value of "+$("#t02Landmark").val(""));
alert("value of "+$("#t02Totalkm").val(""));
}
});

});
}
chirag @ India
RE: onclick event, i need to get the records from database
July 24, 2013 9:35 PM
Answer

chirag @ India

Rank: Regular Member

Posts: 129

Join Date: December 20, 2011

Recent Posts

hi anand ,

check this blog link may be helpful to get value using ajax..

HTH
Chirag@India
anand gopalan
RE: onclick event, i need to get the records from database
July 24, 2013 10:19 PM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hello Sir,

Thank you for your valuable input. But still loop not going inside.

$(document).ready(function(){
alert("1"); //After this alert, loop in not going inside.t02Landmark is the my textfield name &id. when i click the t02Landmark textfield event should fire.but not happen. I attached view.jsp and TravelDetails.java. Please let me know do you need any other file for reference, & where I am doing the mistake.
$("#t02Landmark").click(function()
{
alert("2");
var t02Travelfrom = $("#t02Travelfrom").val();
var t02Travelto=$("#t02Travelto").val();
var dataString4 = 'function=TravelDetails'+'&t02Travelfrom='+ t02Travelfrom+'&t02Travelto='+ t02Travelto;
alert("after dataString4");
if(t02Travelfrom!=0 && t02Travelto!=0)
{
$.ajax({

url: "${getTravelDetailsUrl}",
data: dataString4,
cache: false,
success: function(html)
{
var straaray= html.split("/");
$("#t02Landmark").val(straaray[0]);
$("#t02Totalkm").val(straaray[1]);
alert("value of straaray[0]"+$("#t02Landmark").val(straaray[0]));
}
}); return false;
}else
{
$("#t02Landmark").val("");
$("#t02Totalkm").val("");

alert("value of "+$("#t02Landmark").val(""));
alert("value of "+$("#t02Totalkm").val(""));
}
});

});
}
Attachments: TravelDetails.java (16.4k), view.jsp (12.3k)
Manish Yadav
RE: onclick event, i need to get the records from database
July 24, 2013 11:31 PM
Answer

Manish Yadav

Rank: Expert

Posts: 384

Join Date: May 26, 2012

Recent Posts

First check browser console for javascript error ,if not then Replace below line and check whether you are getting alert(2)
$("#<portlet:namespace />t02Landmark").click(function()

Thanks & Regards
Manish Banwari lal Yadav
anand gopalan
RE: onclick event, i need to get the records from database
July 25, 2013 10:46 PM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hello Manish,

I tried with your suggestion, but I can't succeed.

now I try without click like below in its working and it gone to the serverReource()

View.jsp
function getData(){


alert("calling ajax method getData()");

$(document).ready(function(){
alert("1");

var t02Travelfrom = $("#t02Travelfrom").val();
var t02Travelto=$("#t02Travelto").val();
var dataString4 = 'function=TravelDetails'+'&t02Travelfrom='+ t02Travelfrom+'&t02Travelto='+ t02Travelto;
alert("after dataString4");
if(t02Travelfrom!=0 && t02Travelto!=0)
{
$.ajax({

url: "${getTravelDetailsUrl}",
data: dataString4,
cache: false,
success: function(html)
{
var straaray= html.split("/");
$("#t02Landmark").val(straaray[0]);
$("#t02Totalkm").val(straaray[1]);
alert("success value of straaray[0]--->"+$("#t02Landmark").val(straaray[0]));
}
}); return false;
}else
{
$("#t02Landmark").val("");
$("#t02Totalkm").val("");

alert("value of "+$("#t02Landmark").val(""));
alert("value of "+$("#t02Totalkm").val(""));
}


});
}


Traveldetails.java

public void serveResource(ResourceRequest resourceRequest,ResourceResponse resourceResponse)
throws IOException, PortletException {

System.out.println("********inside serveResource()********");
String cmd = ParamUtil.getString(resourceRequest, Constants.CMD);
if (cmd.equals("2")){
try {
System.out.println("*********inside try in serveResource()***********");
GetTravelDetails(resourceRequest, resourceResponse);
} catch (SystemException e) {

e.printStackTrace();
}
}

}


public void GetTravelDetails(ResourceRequest request, ResourceResponse response) throws SystemException {

System.out.println("********inside GetTravelDetails()********");


/*RenderRequest renderRequest = null;*/

String tfrom =request.getParameter("t02Travelfrom");
String tto = request.getParameter("t02Travelto");

System.out.println("tfrom----->"+tfrom);
System.out.println("tto------->"+tto);

int count = EMP_TRAVEL_DETAILSLocalServiceUtil.getEMP_TRAVEL_DETAILSsCount();
List <EMP_TRAVEL_DETAILS> travelDetailLists = EMP_TRAVEL_DETAILSLocalServiceUtil.getEMP_TRAVEL_DETAILSs(0, count);

String t02Travelfrom;
String t02Travelto;
String t02Landmark;
int t02Totalkm;

String buffer;

for(EMP_TRAVEL_DETAILS travelList:travelDetailLists ){

t02Travelfrom=travelList.getT02Travelfrom();
t02Travelto=travelList.getT02Travelto();
System.out.println("t02Travelfrom----->"+t02Travelfrom);
System.out.println("t02Travelto----->"+t02Travelto);

if(tfrom.equals(t02Travelfrom) && tto.equals(t02Travelto)){

System.out.println("inside if condition");

t02Landmark=travelList.getT02Landmark();
t02Totalkm=travelList.getT02Totalkm();

buffer= t02Landmark +"/" + t02Totalkm ;
System.out.println("buffer values are----->"+buffer);
try {
System.out.println("*****inside try********");
response.getWriter().println(buffer);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

}

}


Now I try to get the value of what I typed, so that I can check the condition if the get value and database get value is same I can get the Landmark & TotalKm f

String tfrom =request.getParameter("t02Travelfrom");
String tto = request.getParameter("t02Travelto");

but i am getting, Plz see the screenshot.
tfrom----->undefined
tto------->undefined
Attachment

Attachments: dataString4.jpg (11.4k), view.jsp (12.6k)
anand gopalan
RE: onclick event, i need to get the records from database
July 26, 2013 12:06 AM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hi,

Now I am getting the value of text field after I modify like below. Even I gave a textfield id but it is not taking. when I checked in the viewsource, in the id=_EmpTravelDetails_WAR_EmpTravelDetailsportlet_t02Travelfrom, so i used var t02Travelfrom=$("#<portlet:namespace />t02Travelfrom").val(); ,

function getData(){


alert("calling ajax method getData()");

$(document).ready(function(){
alert("1");


var t02Travelfrom=$("#<portlet:namespace />t02Travelfrom").val();
var t02Travelto = $("#<portlet:namespace />t02Traveltoid").val();



alert("Value of t02Travelfrom-->"+t02Travelfrom);
alert("Value of t02Travelto-->"+t02Travelto);

var dataString4 = 'function=GetTravelDetails'+'&t02Travelfrom='+ t02Travelfrom+'&t02Travelto='+ t02Travelto;
alert("after dataString4");
alert("value of dataString4"+dataString4);

if(t02Travelfrom!=0 && t02Travelto!=0)
{
$.ajax({

url: "${getTravelDetailsUrl}",
data: dataString4,
cache: false,
success: function(html)
{
var straaray= html.split("/");
$("#t02Landmark").val(straaray[0]);
$("#t02Totalkm").val(straaray[1]);
alert("success value of straaray[0]--->"+$("#t02Landmark").val(straaray[0]));
}
}); return false;
}else
{
$("#t02Landmark").val("");
$("#t02Totalkm").val("");

alert("value of "+$("#t02Landmark").val(""));
alert("value of "+$("#t02Totalkm").val(""));
}


});
}
anand gopalan
RE: onclick event, i need to get the records from database
July 26, 2013 2:38 AM
Answer

anand gopalan

Rank: Expert

Posts: 403

Join Date: March 2, 2012

Recent Posts

Hi,

I have written Jquery/Ajax and call serveResource() , & based on the condition i am getting the records and stored and sent to AJAX.

TravelDetails.java

public void GetTravelDetails(ResourceRequest request, ResourceResponse response) throws SystemException {

System.out.println("********inside GetTravelDetails()********");
.................
............
buffer= t02Landmark +"/" + t02Totalkm ;
System.out.println("buffer values are----->"+buffer);
try {
System.out.println("*****inside try********");
System.out.println("-----------------------");
response.getWriter().println(buffer);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


View.jsp:
if(t02Travelfrom!=0 && t02Travelto!=0)
{
$.ajax({

url: "${getTravelDetailsUrl}",
data: dataString4,
cache: false,
success: function(html)
{
var straaray= html.split("/");
$("#t02Landmark").val(straaray[0]);
$("#t02Totalkm").val(straaray[1]);

alert("success value of straaray[0]--->"+$("#<portlet:namespace />#t02Landmark").val(straaray[0]));---> display undefined
alert("success value of straaray[1]--->"+$("##<portlet:namespace />t02Totalkm").val(straaray[1]));
---> display undefined
}
}); return false;
}else
{
$("#t02Landmark").val("");
$("#t02Totalkm").val("");

alert("value of "+$("#t02Landmark").val(""));
alert("value of "+$("#t02Totalkm").val(""));
}
/* }); */

});


how to display in the view.jsp in the appropriate text fields

<aui:input name="t02Landmark" id="t02Landmarkid" type="text" label="" maxlength="15" value="" onclick="getData()">
<aui:input name="t02Totalkm" type="text" label="" maxlength="7" value="">


And I am getting the output in the console

********inside serveResource()********
*********inside try in serveResource()***********
********inside GetTravelDetails()********
tfrom----->Airport
tto------->BBcircle
t02Travelfrom----->Airport
t02Travelto------->BBcircle
*****inside if condition*****
buffer values are----->Aaa/20
*****inside try********