ajax - json data not set in parent window after clicking a link from child window in java -


i using struts1 in java , database oracle 10g.i want set value in parent window in ajax when clicking link child window.here,json data retrieved not set in field.any solution???please me............

here jsp code-------------------

 function doclick(v1,v2){  		  		var f = document.importletterofcreditbookingform;  		  var v3=window.opener.document.importletterofcreditbookingform.lclimittypecode.value;  					var v4=window.opener.document.importletterofcreditbookingform.lcaccounttypecode.value;  					var v5=window.opener.document.importletterofcreditbookingform.lcbookingnumber.value;  		window.opener.document.importletterofcreditbookingform.customercode.value = v1;  		window.opener.document.importletterofcreditbookingform.customername.value = v2;  		           		/*f.action="/mybank/enterlcdetailslistofimportletterofcreditbooking.do";  		f.submit();*/  		$(document).on('click', function (){  		$.ajax({  			 type:'get',  	      url:'/mybank/enterlcdetailslistofimportletterofcreditbookingjson.do?lclimittypecode='+v3+'&lcaccounttypecode='+v4+'&lcbookingnumber='+v5+'&customercode='+v1,                           datatype:'json',  			success: function(data){	  			  		f.lclimittypecode.value = data.lclimit;  		f.lcaccounttypecode.value = data.lcaccounttype;  		f.lcbookingnumber.value = data.lcbookingno;  		f.customercode.value = data.custcode;  		f.customername.value = data.custname;  		f.customeraddess.value = data.custaddress;  		  		f.bangladeshbanklcnumber.value = data.bbbanklcno;  		f.partydebitaccounttypecode.value = data.partydebaccountcode;  		f.partydebitaccountnumber.value = data.partydebaccountno;  		f.partydebitaccounttitle.value = data.partydebaccounttitle;  		f.ircnumber.value = data.ircno;  		f.vatregistrationnumber.value = data.vatregino;  		f.tinnumber.value = data.tinno;  		f.bankregistrationnumber.value = data.bankregino;  		f.lcfinancecode.value = data.lcfinancecode;  		f.sactionid.value = data.sanctionid;  		f.sanctionserialnumber.value = data.sanctionsrlno;  	f.sanctionamount.value = data.sanctionamount;  		f.lcbookingamount.value = data.lcbookingamount;  		f.ltroutstanding.value = data.ltroutstanding;  		f.padoutstanding.value = data.padoutstanding;  		f.availablegloballimit.value = data.availablegloballimit;  		f.sanctionauthotirycode.value = data.sanctionauthotirycode;  		f.sanctionnumber.value = data.sanctionnumber;  		//f.sanctiondate.value = data.sanctiondate;  		//f.sanctionday.value = data.sanctionday;  		f.lcafnumber.value = data.lcafnumber;  		//f.lcafdate.value = data.lcafdate;  		//f.lcafday.value = data.lcafday;  		f.lcafamountlc.value = data.lcafamountlc;  		//f.bookingdate.value = data.bookingdate;  		//f.bookingday.value = data.bookingday;  		f.foreignlccode.value = data.foreignlccode;  		f.negotiationcode.value = data.negotiationcode;  		f.formoflccode.value = data.formoflccode;  		f.recourseallowedcode.value = data.recourseallowedcode;  		f.categotycode.value = data.categotycode;  		f.typeoflccode.value = data.typeoflccode;  		f.sightpercentage.value = data.sightpercentage;  		f.communicationmediacode.value = data.communicationmediacode;  		f.drawee.value = data.drawee;  		f.ratecode.value = data.ratecode;  		f.tradetermcode.value = data.tradetermcode;  		f.countryoforigincode.value = data.countryoforigincode;  		f.countryoforigincodedesc.value = data.countryoforigincodedesc;  		f.beneficiaryid.value = data.beneficiaryid;  		f.beneficiaryname.value = data.beneficiaryname;  		f.beneficiaryaddress.value = data.beneficiaryaddress;  		f.modeoftransportcode.value = data.modeoftransportcode;  		f.availablebycode.value = data.availablebycode;  		f.availablewithcode.value = data.availablewithcode;  		f.ammendmentnumber.value = data.ammendmentnumber;  		//f.ammendmentdate.value = data.ammendmentdate;  		//f.dateofissue.value = data.dateofissue;  		//f.lcissueday.value = data.lcissueday;  		f.lcexpirydate.value = data.lcexpirydate;  		//f.lcexpiryday.value = data.lcexpiryday;  		f.placeofexpiry.value = data.placeofexpiry;  		//f.shipmentdate.value = data.shipmentdate;  		f.shipmentperiod.value = data.shipmentperiod;  		f.currencycode.value = data.currencycode;  		f.exchangerate.value = data.exchangerate;  		f.tolerancepercentagepositive.value = data.tolerancepercentagepositive;  		f.tolerancepercentagenegative.value = data.tolerancepercentagenegative;  		f.lcopenvaluefcy.value = data.lcopenvaluefcy;  		f.lcopenvaluelcy.value = data.lcopenvaluelcy;  		f.lccurrentvaluefcy.value = data.lccurrentvaluefcy;  		f.lccurrentvaluelcy.value = data.lccurrentvaluelcy;  		f.lcvaluefcy.value = data.lcvaluefcy;  		f.lcvaluelcy.value = data.lcvaluelcy;  		f.statusofcreditcode.value = data.statusofcreditcode;  		f.usanceindays.value = data.usanceindays;  		f.fromport.value = data.fromport;  		f.transportto.value = data.transportto;  		f.shipmentperiod.value = data.shipmentperiod;  		f.partshipmentallowedcode.value = data.partshipmentallowedcode;  		f.transhipmentallowedcode.value = data.transhipmentallowedcode;  		f.confirminstructioncode.value = data.confirminstructioncode;  		f.transferablecode.value = data.transferablecode;  		f.lcstatus.value = data.lcstatus;  		f.advisingbankcode.value = data.advisingbankcode;  		f.advisingbranchcode.value = data.advisingbranchcode;  		f.advisingbankcodedesc.value = data.advisingbankcodedesc;  		f.advisethroughbankcode.value = data.advisethroughbankcode;  		f.advisethroughbranchcodedesc.value = data.advisethroughbranchcode;  		f.advisethroughbankcodedesc.value = data.advisethroughbankcodedesc;  		f.negotiatingbankcode.value = data.negotiatingbankcode;  		f.negotiatingbranchcode.value = data.negotiatingbranchcode;  		f.negotiatingbankcodedesc.value = data.negotiatingbankcodedesc;  		f.transferingbankcode.value = data.transferingbankcode;  		f.transferingbranchcode.value = data.transferingbranchcode;  		f.transferingbankcodedesc.value = data.transferingbankcodedesc;  		f.reimbursingbankcode.value = data.reimbursingbankcode;  		f.reimbursingbranchcode.value = data.reimbursingbranchcode;  		f.reimbursingbankcodedesc.value = data.reimbursingbankcodedesc;  		f.confirmingbankcode.value = data.confirmingbankcode;  		f.confirmingbranchcode.value = data.confirmingbranchcode;  		f.confirmingbankcodedesc.value = data.confirmingbankcodedesc;  		f.applicantbankcode.value = data.applicantbankcode;  		f.applicantbranchcode.value = data.applicantbranchcode;  		f.applicantbankcodedesc.value = data.applicantbankcodedesc;  		f.insurancebankcode.value = data.insurancebankcode;  		f.insurancebranchcode.value = data.insurancebranchcode;  		f.insurancebankcodedesc.value = data.insurancebankcodedesc;  		f.insurancecovernotenumber.value = data.insurancecovernotenumber;  		//f.insurancecovernoteissuedate.value = data.insurancecovernoteissuedate;  		//f.insurancecovernoteday.value = data.insurancecovernoteday;  		f.indentperformflagcode.value = data.indentperformflagcode;  		f.indentperforminvoicenumber.value = data.indentperforminvoicenumber;  		//f.indentperforminvoicedate.value = data.indentperforminvoicedate;  		f.indentperforminvoicevalue.value = data.indentperforminvoicevalue;  		f.indentornameandaddress.value = data.indentornameandaddress;  		f.ccianderegistrationnumber.value = data.ccianderegistrationnumber;  		f.bangladeshbankperformancenumber.value = data.bangladeshbankperformancenumber;  		f.crfcompany.value = data.crfcompany;  		f.sequencetotal.value = data.sequencetotal;  		f.periodpresent.value = data.periodpresent;  		f.charges.value = data.charges;  		f.statusoftrnsdocumentcode.value = data.statusoftrnsdocumentcode;  		f.overseasbankchargepaidbycode.value = data.overseasbankchargepaidbycode;  		f.instruction.value = data.instruction;  		f.sendtoreciver.value = data.sendtoreciver;  		f.documentrequired.value = data.documentrequired;  		f.conditions.value = data.conditions;  		f.additionalconditions.value = data.additionalconditions;  		f.availablegloballimit.value = data.available;  		f.goodsdetails.value = data.goodsdetails;  		f.hscode.value = data.hscode;  		  				}        });	  		});          		window.close();      }
 <td valign="top" class="lbl-08" align="center"><a href="#" onclick="doclick('<%=scustomerid%>','<%=scustomername%>')"><font class="link-b-08"><%=sselect%></font></a></td>

if have defined global variable in parent window like

var var1 = "value1"  

then can access/change in child window using

parent.var1 = "value2" 

if want change form elements of parent window child window, can set like

 window.opener.document.getelementbyid('textbox1').value="put value here"; 

see similar threads here , here.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -