Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Servlets
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Liutauras Vilda
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Servlets
How to show value After submit data
Sharon Wong
Ranch Hand
Posts: 39
I like...
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Team,
The below is my popup window coding when user create product:
function fnConfirm() { if(<%= chkStat%>){ $.prompt('Are you sure want to create this product?',{ buttons:[ {title: 'Yes',value:true}, {title: 'No',value:false} ], focus: 1, submit: function(e,v,m,f){closeWindow(v);} }); } } function closeWindow(val) { if(val==true) { document.foProduct.subcmd.value = "insertAddProduct"; // insert data to db document.foProduct.submit(); window.close(); }else{ Releasebuttons(document.foProduct); } } var requestObj = null; function isMrktPrdtExist(mrktcd,prodcd) { if(document.foProduct.mrktcd.value =="" || document.foProduct.prodcd.value=="" || document.foProduct.descriptn.value=="" || document.foProduct.prodCd1.value =="" || document.foProduct.isin.value == "" || document.foProduct.currcode.value ==""){ alert("Mandatory fields needed."); Releasebuttons(document.foProduct); }else if(document.foProduct.mrktcd.value == document.foProduct.defMrktCd.value){ alert('Please enter Foreign Product only'); Releasebuttons(document.foProduct); }else{ requestObj = ajaxInitRequest(requestObj); var url = "<%=request.getContextPath()%>/ajaxJsp/MrktProdDetailValidation.jsp?&mrktCd="+mrktcd+" &prodCd="+prodcd; requestObj.open("GET", url, true); requestObj.onreadystatechange = validateMrkProdDtl; requestObj.send(null); } } function validateMrkProdDtl(){ if (requestObj.readyState == 4 && requestObj.status == 200) { var xmlDoc = requestObj.responseXML; var mrktCdProd = xmlDoc.getElementsByTagName("mrktCdProd")[0]; var mrktCdProdInd = mrktCdProd.firstChild.nodeValue; if(mrktCdProdInd == 'N'){ document.foProduct.subcmd.value = "addfrgProd"; //only validate field document.foProduct.submit(); opener.document.foFrgTrd.mrktcdRd.value = document.foProduct.mrktcdSd.value; opener.document.foFrgTrd.prodcdRd.value = document.foProduct.prodcdSd.value; }else{ alert('This product exist in PRODUCT'); Releasebuttons(document.foProduct); } } }
This is
servlet
when i create the product.
public void service(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException { HttpSession session = req.getSession(false); hashErr = (HashMap) req.getAttribute("HashMapErrMsg"); String subcmd = (String)req.getParameter("subcmd"); MaintainForeignTradeCommand cmd = new MaintainForeignTradeCommand(); String next = "jsp/CommandNotFound.jsp"; String error = "jsp/error.jsp"; try { if(subcmd.equals("insertAddProduct")) { next = insertAddProduct(req, "jsp/ForeignTradeInsert.jsp", "jsp/ForeignAddProduct.jsp"); } else { throw new CommandException("Invalid Command"); } } catch (CommandException e) { logWriter.log("Cannot get cmd : "+subcmd, LogWriter.ERROR); logWriter.log("CommandException caught : "+e.getMessage(), LogWriter.ERROR); next = error; } if (!subcmd.equals("getBasisCd") ){ RequestDispatcher dispatcher=getServletContext().getRequestDispatcher("/"+next); if (!FormUtil.returnString(subcmd).equals("lov")) { CommandToken.set(req); } dispatcher.forward(req, res); } } public String insertAddProduct(HttpServletRequest req, String nextPage, String prevPage) { String next = nextPage; HttpSession session = req.getSession(false); //Vector errors = new Vector(); Vector<String> errors = new Vector<String>(); String subcmd= FormUtil.returnString(req.getParameter("subcmd")); try { product = new ProductDA(); FrgnPdtRefDA frgnPdtRefDA = new FrgnPdtRefDA(); FormUtil formUtil = new FormUtil(); ErrorBean ErrorBean = new ErrorBean(); CnaConvBean peBean = new CnaConvBean(); FrgnPdtRefBean fpRefBean = new FrgnPdtRefBean(); //Getting apparm from the session String areas = session.getAttribute("apparm_AREAS") != null ? (String) session.getAttribute("apparm_AREAS") : ""; //get the prodclscd to identify if is a loan stock counter or a warrant counter String companyid = (String)session.getAttribute("defCompany"); String loanparmval1 = formUtil.getApparmValue(companyid, "SB", "LOANSTOCK"); String loanparmval2 = formUtil.getApparmValue(companyid, "SB", "CONVLSTOCK"); String warrparmval = formUtil.getApparmValue(companyid, "SB", "WARSTOCK"); String bondparmval = formUtil.getApparmValue(companyid, "SB", "BONDCOUNTER"); String warrparmval2 = formUtil.getApparmValue(companyid, "SB","CALLWARSTOCK"); //Product Table String mrktCd = FormUtil.returnString(req.getParameter("mrktcd")).toUpperCase(); String prodCd = FormUtil.returnString(req.getParameter("prodcd")).toUpperCase(); String descriptn = FormUtil.returnString(req.getParameter("descriptn")).toUpperCase(); String prodClsCd = FormUtil.returnString(req.getParameter("prodclscd")).toUpperCase(); String shrGrdCd = FormUtil.returnString(req.getParameter("shrgrdcd")).toUpperCase(); String basisCd = FormUtil.returnString(req.getParameter("basiscd")).toUpperCase(); String mrktSymb = FormUtil.returnString(req.getParameter("mrktsymb")).toUpperCase(); String cdsShare = FormUtil.returnString(req.getParameter("cdsshare")).toUpperCase(); String oddLotInd = FormUtil.returnString(req.getParameter("oddlotind")).toUpperCase(); String callWarInd = FormUtil.returnString(req.getParameter("callwarind")).toUpperCase(); String shortSell = FormUtil.returnString(req.getParameter("shortsell")).toUpperCase(); String registrCd = FormUtil.returnString(req.getParameter("registrcd")).toUpperCase(); String registrChg = FormUtil.returnString(req.getParameter("registrchg")).toUpperCase(); String dtStartCds = FormUtil.returnString(req.getParameter("dtstartcds")).toUpperCase(); String dtEndCds = FormUtil.returnString(req.getParameter("dtendcds")).toUpperCase(); String rblCd = FormUtil.returnString(req.getParameter("rblcd")).toUpperCase(); int lotSize = FormUtil.returnInteger(req.getParameter("lotsize")); String dtStartRbl = FormUtil.returnString(req.getParameter("dtstartrbl")).toUpperCase();; String dtEndRbl = FormUtil.returnString(req.getParameter("dtendrbl")).toUpperCase();; String prodStat = FormUtil.returnString(req.getParameter("prodstat")).toUpperCase();; String dtMature = FormUtil.returnString(req.getParameter("dtmature")); String dtSuspnd = FormUtil.returnString(req.getParameter("dtsuspnd")).toUpperCase();; String dtRelisted = FormUtil.returnString(req.getParameter("dtrelisted")).toUpperCase();; String dtStartMrg = FormUtil.returnString(req.getParameter("dtstartmrg")).toUpperCase();; double closePrice = FormUtil.returnDouble(req.getParameter("closeprice")); String clsPrcdt = FormUtil.returnString(req.getParameter("clsprcdt")).toUpperCase();; double minPrclChk = FormUtil.returnDouble(req.getParameter("minprclchk")); double maxPrclChk = FormUtil.returnDouble(req.getParameter("maxprclchk")); String issuer = FormUtil.returnString(req.getParameter("issuer")).toUpperCase(); String secinCd = formSecInCd(mrktCd, prodCd); String currCode = FormUtil.returnString(req.getParameter("currcode")).toUpperCase(); //Hardcoded Currcode to "-" when CAD folder is disabled String prodCd1 = FormUtil.returnString(req.getParameter("prodCd1")).toUpperCase(); String suspdReasn = FormUtil.returnString(req.getParameter("suspdReasn")).toUpperCase(); String date1 = FormUtil.returnString(req.getParameter("date1")); String date2 = FormUtil.returnString(req.getParameter("date2")); //Product extension for ARMADA String indxCd = FormUtil.returnString(req.getParameter("indxCd")).toUpperCase(); String drvparmval = formUtil.getApparmValue(companyid, "SB", "DERIVATIVES"); String fiparmval = formUtil.getApparmValue(companyid, "SB", "FIXEDINCOME"); String sType = FormUtil.returnString(req.getParameter("sType")).toUpperCase(); String subType = FormUtil.returnString(req.getParameter("subType")).toUpperCase(); String seGrpId = FormUtil.returnString(req.getParameter("seGrpId")).toUpperCase(); int cnSize = FormUtil.returnInteger(req.getParameter("cnSize")); String cnMthYr = FormUtil.returnString(req.getParameter("cnMthYr")).toUpperCase(); double strikePrc = FormUtil.returnDouble(req.getParameter("strikePrc")); double settlPrc = FormUtil.returnDouble(req.getParameter("settlPrc")); String carFlag = FormUtil.returnString(req.getParameter("carFlag")).toUpperCase(); String drv_dtmature = FormUtil.returnString(req.getParameter("drv_dtmature")); String cr_sType = FormUtil.returnString(req.getParameter("cr_sType")); String cr_subType = FormUtil.returnString(req.getParameter("cr_subType")); String crRating = FormUtil.returnString(req.getParameter("crRating")).toUpperCase(); String fi_dtmature = FormUtil.returnString(req.getParameter("fi_dtmature")); /* * Added by Lim Yan 16/6/06 */ String previousName = FormUtil.returnString(req.getParameter("prevNm")); String marginInd = FormUtil.returnString(req.getParameter("margInd")); String pn4Ind = FormUtil.returnString(req.getParameter("pn4Ind")); int volume = FormUtil.returnInteger(req.getParameter("trdVol")); double highPrice = FormUtil.returnDouble(req.getParameter("highPrice")); double lowPrice = FormUtil.returnDouble(req.getParameter("lowPrice")); double vwAvgPrice = FormUtil.returnDouble(req.getParameter("vwAvgPrice")); double ipoPrice = FormUtil.returnDouble(req.getParameter("ipo_exerprc")); String ipoCapInd = FormUtil.returnString(req.getParameter("ipo_cap")); String ipoExpDate = FormUtil.returnString(req.getParameter("ipo_dtexpiry")); String pn17Ind = FormUtil.returnString(req.getParameter("pn17Ind")); String allowAvg = FormUtil.returnString(req.getParameter("amalgamation")); //Added by Siva 01/06/2011 // String prodDesc1 = FormUtil.returnString(req.getParameter("prodDesc1")).toUpperCase(); // String prodDesc2 = FormUtil.returnString(req.getParameter("prodDesc2")).toUpperCase(); // String prodDesc3 = FormUtil.returnString(req.getParameter("prodDesc3")).toUpperCase(); String esCodeTag = ""; String[] esCodeTags = req.getParameterValues("esCodeTag"); if(esCodeTags != null){ for (int i = 0; i < esCodeTags.length; i++) { esCodeTag += esCodeTags[i]; } } peBean.setPreviousName(previousName.toUpperCase()); peBean.setMarginInd(marginInd); peBean.setPn4Ind(pn4Ind); peBean.setVolume(volume); peBean.setHighPrice(highPrice); peBean.setLowPrice(lowPrice); peBean.setVwAvgPrice(vwAvgPrice); peBean.setIpoPrice(ipoPrice); peBean.setIpoCapInd(ipoCapInd); peBean.setIpoExpDate(ipoExpDate); peBean.setPn17Ind(pn17Ind); peBean.setAllowAvg(allowAvg); // The Product Bean ProductBean prBean = new ProductBean(); SecMastBean scBean = new SecMastBean(); prBean.setMrktCd(mrktCd); prBean.setProdCd(prodCd); prBean.setProdCd1(prodCd1); // prBean.setMrktSymb(mrktSymb); //Modified by GimHan, 2013/02/06 if(mrktSymb.equals("") || mrktSymb.equals(null)){ prBean.setMrktSymb(prodCd); }else{ prBean.setMrktSymb(mrktSymb); } if(descriptn != null){ if(descriptn.length() >= 30){ prBean.setDescriptn(descriptn.substring(0, 30)); scBean.setDescriptn(descriptn.substring(0, 30)); } else{ prBean.setDescriptn(descriptn); scBean.setDescriptn(descriptn); } if(descriptn.length() >= 90) prBean.setProdDesc1(descriptn.substring(30, 90)); else if(descriptn.length() >= 30 && descriptn.length() < 90) prBean.setProdDesc1(descriptn.substring(30)); else prBean.setProdDesc1(""); if(descriptn.length() >= 150) prBean.setProdDesc2(descriptn.substring(90, 150)); else if(descriptn.length() >= 90 && descriptn.length() < 150) prBean.setProdDesc2(descriptn.substring(90)); else prBean.setProdDesc2(""); if(descriptn.length() >= 210) prBean.setProdDesc3(descriptn.substring(150, 210)); else if(descriptn.length() >= 150 && descriptn.length() < 210) prBean.setProdDesc3(descriptn.substring(150)); else prBean.setProdDesc3(""); } prBean.setProdClsCd(prodClsCd); prBean.setShrGrdCd(shrGrdCd.toUpperCase()); prBean.setBasisCd(basisCd); prBean.setCdsShare(cdsShare); prBean.setOddLotInd(oddLotInd); prBean.setCallWarInd(callWarInd); prBean.setShortSell(shortSell); // prBean.setCompCf(compCf); // prBean.setSrvRtCdDs(srvRtCdDs); prBean.setRegistrCd(registrCd); prBean.setRegistrChg(registrChg); prBean.setRblCd(rblCd); prBean.setLotSize(lotSize); prBean.setProdStat(prodStat); prBean.setClosePrice(closePrice); prBean.setMinPrclChk(minPrclChk); prBean.setMaxPrclChk(maxPrclChk); prBean.setIssuer(mrktCd); prBean.setSecInCd(secinCd); prBean.setCurrCode(currCode); prBean.setSuspdReasn(suspdReasn); prBean.setText2(FormUtil.returnString(req.getParameter("fmStockType")).toUpperCase()); prBean.setText3(FormUtil.returnString(req.getParameter("SusType")).toUpperCase()); prBean.setUsrCreated((String)session.getAttribute("userID")); prBean.setDtStartCds(dtStartCds); prBean.setDtSuspnd(dtSuspnd); prBean.setDtRelisted(dtRelisted); prBean.setDtStartMrg(dtStartMrg); prBean.setClsPrcdt(clsPrcdt); prBean.setDtEndCds(dtEndCds); prBean.setDtStartRbl(dtStartRbl); prBean.setDtEndRbl(dtEndRbl); //added Siva on 29/07/10 prBean.setEsCodeTag(esCodeTag); prBean.setDate1(date1); prBean.setDate2(date2); //Set bean value for ARMADA product derivatives prBean.setIndxCd(indxCd); prBean.setSeGrpId(seGrpId); prBean.setCnSize(cnSize); prBean.setCnMthYr(cnMthYr); prBean.setStrikePrc(strikePrc); prBean.setSettlPrc(settlPrc); prBean.setCarFlag(carFlag); prBean.setParmValue(drvparmval); prBean.setParmValue1(fiparmval); //Set ProdDesc values // prBean.setProdDesc1(prodDesc1); // prBean.setProdDesc2(prodDesc2); // prBean.setProdDesc3(prodDesc3); if(prBean.getProdClsCd().equals(drvparmval)) { prBean.setSecType(sType); prBean.setSubType(subType); prBean.setDtMature(drv_dtmature); }else if(prBean.getProdClsCd().equals(fiparmval)) { prBean.setCrRating(crRating); prBean.setSecType(cr_sType); prBean.setSubType(cr_subType); prBean.setDtMature(fi_dtmature); } //SecMast Table String mktBoardCd = FormUtil.returnString(req.getParameter("mktboardcd")).toUpperCase(); String mrktSectCd = FormUtil.returnString(req.getParameter("mrktsectcd")).toUpperCase(); String dtListed = FormUtil.returnString(req.getParameter("dtlisted")).toUpperCase(); String isin = FormUtil.returnString(req.getParameter("isin")).toUpperCase(); String secType = FormUtil.returnString(req.getParameter("sectype")).toUpperCase(); double maxConcent = FormUtil.returnDouble(req.getParameter("maxconcent")); String islSecInd = FormUtil.returnString(req.getParameter("islsecind")).toUpperCase(); double authCap = FormUtil.returnDouble(req.getParameter("authcap")); double paidCap = FormUtil.returnDouble(req.getParameter("paidcap")); long shrIssQt = FormUtil.returnLong(req.getParameter("shrissqt")); double parValue = FormUtil.returnDouble(req.getParameter("parvalue")); double frgnOwnLmt = FormUtil.returnDouble(req.getParameter("frgnownlmt")); double adjustcap = FormUtil.returnDouble(req.getParameter("adjustcap")); // String cusip = FormUtil.returnString(req.getParameter("cusip")); scBean.setMktBoardCd(mktBoardCd); scBean.setMrktSectCd(mrktSectCd); scBean.setIsIn(isin); scBean.setSecType(secType); scBean.setMaxConcent(maxConcent); scBean.setIslSecInd(islSecInd); scBean.setAuthCap(authCap); scBean.setPaidCap(paidCap); scBean.setShrIssQt(shrIssQt); scBean.setParValue(parValue); scBean.setFrgnOwnLmt(frgnOwnLmt); scBean.setSecInCd(secinCd); scBean.setMrktCd(mrktCd); scBean.setShrHldCost1(adjustcap);//SECMAST.SHRHLDCOST scBean.setDtListed(dtListed); //CadProdExt Table String priceTp = FormUtil.returnString(req.getParameter("pricetp")).toUpperCase(); double priceMltpl = FormUtil.returnDouble(req.getParameter("pricemltpl")) ; //Hardcoded Multipier to "-" when CAD folder is disabled double depositRec = FormUtil.returnDouble(req.getParameter("depositrec")); double quantity1 = FormUtil.returnDouble(req.getParameter("quantity1")); String dtIssue = FormUtil.returnString(req.getParameter("dtissue")).toUpperCase(); String lstCoupDt = FormUtil.returnString(req.getParameter("lstcoupdt")).toUpperCase(); String nxtCoupDt = FormUtil.returnString(req.getParameter("nxtcoupdt")).toUpperCase(); String nxtExerDt = FormUtil.returnString(req.getParameter("nxtexerdt")).toUpperCase(); String underlying = FormUtil.returnString(req.getParameter("underlying")).toUpperCase(); String guarantor = FormUtil.returnString(req.getParameter("guarantor")).toUpperCase(); String text1 = FormUtil.returnString(req.getParameter("text1")).toUpperCase(); int bondInTfq = FormUtil.returnInteger(req.getParameter("bondintfq")); double bondFxrt = FormUtil.returnDouble(req.getParameter("bondfxrt")); double bondInTrt = FormUtil.returnDouble(req.getParameter("bondintrt")); CadProdExtBean caBean = new CadProdExtBean(); caBean.setMrktCd(mrktCd); caBean.setProdCd(prodCd); caBean.setCurrCode(currCode); caBean.setPriceTp(priceTp); caBean.setPriceMlTpl(priceMltpl); caBean.setDepositRec(depositRec); caBean.setQuantiTy1(quantity1); caBean.setUnderLying(underlying); caBean.setGuaranTor(guarantor); caBean.setText1(text1); caBean.setBondInTfq(bondInTfq); caBean.setBondFxrt(bondFxrt); caBean.setBondInTrt(bondInTrt); // if(dtIssue.equals("")){ caBean.setDtIssue(dtIssue); // } // if(lstCoupDt.equals("")){ caBean.setLstCoupdt(lstCoupDt); // } // if(nxtCoupDt.equals("")){ caBean.setNxtCoupdt(nxtCoupDt); // } // if(nxtExerDt.equals("")){ caBean.setNxtExerdt(nxtExerDt); // } ///*******************************************************************************// // new added fields for warrant and loan stock String unit = FormUtil.returnString(req.getParameter("unit")); peBean.setRefNo1(unit);//PRODUCTEXT.UNITIND // Add by Sharon 19-02-2016 // for Auto-create new stock in EO usage // Product reference String fBroker = FormUtil.returnString(req.getParameter("fBroker")).trim().toUpperCase(); String remarkCd1 = FormUtil.returnString(req.getParameter("remarkcd")).toUpperCase(); fpRefBean.setMrktCd(mrktCd); fpRefBean.setProdCd(prodCd); fpRefBean.setFrgBrk(fBroker); fpRefBean.setMapmrk(mrktCd); fpRefBean.setMapcd1(prodCd); fpRefBean.setUsrCreated((String)session.getAttribute("userID")); prBean.setRemarkCd(remarkCd1); boolean loanInd1 = false; boolean loanInd2 = false; boolean warrInd1 = false; boolean warrInd2 = false; String strArr[]=null; if(loanparmval1 != null){ strArr = loanparmval1.split(","); for(int i=0;i<strArr.length;i++){ if(prodClsCd.equals(strArr[i])){ loanInd1=true; } } } if(loanparmval2 != null){ strArr = loanparmval2.split(","); for(int i=0;i<strArr.length;i++){ if(prodClsCd.equals(strArr[i])){ loanInd2=true; } } } //if the product class cd is a loan stock if(loanInd1 || loanInd2 || prodClsCd.equals("I") || prodClsCd.equals("X")){ scBean.setMthShare(FormUtil.returnString(req.getParameter("lmtshr")).toUpperCase()); prBean.setDtMature(FormUtil.returnString(req.getParameter("ldtmature")).toUpperCase()); //prBean.setConvPric(FormUtil.returnDouble(req.getParameter("lexerprc"))); prBean.setExeRprc(FormUtil.returnDouble(req.getParameter("lexerprc"))); prBean.setDtExerase(FormUtil.returnString(req.getParameter("ldtexerase")).toUpperCase()); prBean.setCouponR(FormUtil.returnDouble(req.getParameter("couponr"))); prBean.setCalcMtd(FormUtil.returnString(req.getParameter("calcmtd")).toUpperCase()); prBean.setPeriodType(FormUtil.returnString(req.getParameter("periodtype")).toUpperCase()); caBean.setDate1(FormUtil.returnString(req.getParameter("llstcoupdt")).toUpperCase()); //CADPRODEXT.lstcoupdt caBean.setDate2(FormUtil.returnString(req.getParameter("lnxtcoupdt")).toUpperCase()); //CADPRODEXT.nxtcoupdt peBean.setLoanType(FormUtil.returnString(req.getParameter("loantype")).toUpperCase()); peBean.setDtIssue(FormUtil.returnString(req.getParameter("ldtissue")).toUpperCase()); peBean.setNominalPrc(FormUtil.returnDouble(req.getParameter("lnominalprc"))); peBean.setTopUpPrc(FormUtil.returnDouble(req.getParameter("ltopupprc"))); peBean.setNoOfShr(FormUtil.returnLong (req.getParameter("lnoofshr"))); peBean.setConvMonth(FormUtil.returnString(req.getParameter("lconvmonth")).toUpperCase()); peBean.setRemarks(FormUtil.returnString(req.getParameter("lremarks")).toUpperCase()); peBean.setDate1(FormUtil.returnString(req.getParameter("ldtstartint")).toUpperCase());//PRODUCTEXT.dtstartint peBean.setDate2(FormUtil.returnString(req.getParameter("ldtendint")).toUpperCase()); //PRODUCTEXT.dtendint peBean.setNomInd(FormUtil.returnString(req.getParameter("lcaind")).toUpperCase()); //PRODUCTEXT.caind } if(warrparmval != null){ strArr = warrparmval.split(","); for(int i=0;i<strArr.length;i++){ if(prodClsCd.equals(strArr[i])){ warrInd1=true; } } } if(warrparmval2 != null){ strArr = warrparmval2.split(","); for(int i=0;i<strArr.length;i++){ if(prodClsCd.equals(strArr[i])){ warrInd2=true; } } } //if the product class cd is a warrant stock if(warrInd1 || warrInd2){ double premPrc = FormUtil.returnDouble(req.getParameter("premprc")); dtMature = FormUtil.returnString(req.getParameter("dtmature")).toUpperCase();; String dtExerase = FormUtil.returnString(req.getParameter("dtexerase")).toUpperCase();; double exerPrc = FormUtil.returnDouble(req.getParameter("exerprc")); String remarkCd = FormUtil.returnString(req.getParameter("remarkcd")).toUpperCase(); prBean.setPremPrc(premPrc); prBean.setExeRprc(exerPrc); prBean.setRemarkCd(remarkCd); prBean.setDtMature(dtMature); prBean.setDtExerase(dtExerase); scBean.setMthShare(FormUtil.returnString(req.getParameter("wmtshr")).toUpperCase()); prBean.setDtEndTrd(FormUtil.returnString(req.getParameter("wdtendtrd")).toUpperCase()); peBean.setAmount1(FormUtil.returnDouble(req.getParameter("wconvnum"))); //double: productext.CONVNUM peBean.setAmount2(FormUtil.returnDouble(req.getParameter("wconvdenom"))); //double: productext.CONVDENOM } // values for BOND product type if(prodClsCd.equals(bondparmval)) { dtMature = FormUtil.returnString(req.getParameter("bond_dtmature")).toUpperCase(); double exerPrc = FormUtil.returnDouble(req.getParameter("bond_exerprc")); prBean.setExeRprc(exerPrc); prBean.setDtMature(dtMature); } logWriter.log(">>>Validate Index Code<<<", LogWriter.DEBUG); IndexDA ida = new IndexDA(); IndexBean ibean = new IndexBean(); ibean.setIndxCd(prBean.getIndxCd()); ibean.setMrktCd(prBean.getMrktCd()); logWriter.log(">>>index cd="+ibean.getIndxCd(), LogWriter.DEBUG); logWriter.log(">>>mrkt cd="+ibean.getMrktCd(), LogWriter.DEBUG); if(ibean.getIndxCd().length()>0 && ida.validateIndex(ibean)){ errors.add("The index code entered is not maintained. Please enter again."); } ForeignTradeBean foreignTradeBean = new ForeignTradeBean(); if(product.insert(prBean,scBean,caBean,peBean) && frgnPdtRefDA.insert(fpRefBean)) { foreignTradeBean.setMrktCd(prBean.getMrktCd()); foreignTradeBean.setProdCd(prBean.getProdCd()); foreignTradeBean = (ForeignTradeBean) req.getAttribute("bean"); req.setAttribute("bean", foreignTradeBean); } else { if ((hashErr.containsKey(prBean.getErrValue()))) { MaintainForeignTradeCommand cmd = new MaintainForeignTradeCommand(); foreignTradeBean.setErrMsg("Insert PRODUCT Unsuccessful.Please enter correct values"); //errors.add("Insert PRODUCT Unsuccessful.Please enter correct values"); foreignTradeBean = (ForeignTradeBean) req.getAttribute("bean"); //prBean.setTopErrMsg( "Insert PRODUCT Unsuccessful.Please enter correct values" ); //next = nextPage; //next =cmd.displayFrgTrd(req, "jsp/ForeignTradeInsert.jsp", "jsp/ForeignAddProduct.jsp"); } else if ((hashErr.containsKey(fpRefBean.getErrValue()))) { foreignTradeBean.setErrMsg("Insert PRODREF Unsuccessful.Please enter correct values"); //errors.add("Insert PRODREF Unsuccessful.Please enter correct values"); //req.setAttribute("bean", fpRefBean); } else { prBean.setTopErrMsg( hashErr.get( "50505" ).toString() ); } //prBean.setDescriptn(descriptn); //next = prevPage; } //String[] errorArray = (String[])errors.toArray(new String[0]); //req.setAttribute("errors", errorArray); /*if (errors.size() != 0) { logWriter.log("the errors size is not empty", LogWriter.DEBUG); MaintainForeignTradeCommand cmd = new MaintainForeignTradeCommand(); String[] errorArray = (String[])errors.toArray(new String[0]); req.setAttribute("errors", errorArray); //prBean.setDescriptn(descriptn); foreignTradeBean.setErrMsg("Insert PRODUCT Unsuccessful.Please enter correct values"); //next = "jsp/ForeignTradeInsert.jsp"; // next =cmd.displayFrgTrd(req, "jsp/ForeignTradeInsert.jsp", "jsp/ForeignTradeInsert.jsp"); }*/ req.setAttribute("prBean", prBean); req.setAttribute("bean", foreignTradeBean); //req.setAttribute("caBean", caBean); //req.setAttribute("scBean", scBean); //req.setAttribute("peBean", peBean); } catch (Exception e) { logWriter.log("insertAddProduct Exception : "+e.getMessage(), LogWriter.ERROR); } return next; }
The error value will set to this bean:foreignTradeBean.setErrMsg() when i have error insert data. How to show this error value at this
JSP
? This JSP is parent JSP(ForeignTradeInsert.jsp) after this popup window close.
<%@ include file="Properties.jsp" %> <% HttpSession session = request.getSession(false); String theme = session.getAttribute("theme")== null ? defThemeColour : (String) session.getAttribute("theme"); %> <%@ page session="false" %> <%@ page import="java.sql.*,com.ait.beans.AcMastBean,com.ait.beans.MarketBean,com.ait.util.FormUtil,com.ait.beans.ProductBean"%> <% ProductBean prBean = (ProductBean) request.getAttribute("prBean"); %> <jsp:useBean id="format" class="com.ait.beans.DecimalBean" scope="request"/> <jsp:useBean id="bean" class="com.ait.beans.ForeignTradeBean" scope="request"/> <jsp:useBean id="AcMastCollBean" class="com.ait.beans.AcMastCollBean" /> <jsp:useBean id="acmast" class="com.ait.beans.AcMastBean" /> <%@ page import="com.ait.beans.CurrencyCollBean,com.ait.beans.CurrencyBean"%> <jsp:useBean id="CurrencyCollBean" class="com.ait.beans.CurrencyCollBean" /> <% CurrencyBean curr = new CurrencyBean(); CurrencyBean[] currencyList = CurrencyCollBean.getList(); String companyId = (String)session.getAttribute("defCompany"); String branchId = (String)session.getAttribute("defBranch"); String eafId = (String)session.getAttribute("defEaf"); String defCurrency = new com.ait.util.FormUtil().getApparmValue(companyId, "SB", "CURRENCY"); AcMastBean[] fbList = AcMastCollBean.foreignList(companyId, branchId, eafId); String frgIssGrp = (String)request.getAttribute("frgIssGrp"); boolean chkExt = request.getAttribute("chkExt")==null?false:(Boolean) request.getAttribute("chkExt"); %> <% String[] errors = (String[])request.getAttribute("errors"); String warning = request.getAttribute("warning")!=null?(String)request.getAttribute("warning"):"0"; %> <html> <link rel="stylesheet" href="../theme/<%=theme %>/master.css"> <head> <%-- Load jQuery Lib's Start--%> <script src="../jQuerylib/jquery.js" type="text/javascript"> </script> <script src="../jQuerylib/jquery-impromptu.js" type="text/javascript"> </script> <link rel="stylesheet" href="../frmValidations/css/dialog.css" /> <%-- Load jQuery Lib's End--%> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <script language="JavaScript" src="../jscripts/common/misc.js"></script> <script language="JavaScript" src="../jscripts/common/calendar.js"></script> <script type="text/javascript" src="../jscripts/common/ajax.js"></script> <script language="JavaScript"> function ajaxBank_lookup() { bank1_lookup(document.foFrgTrd.bankCd, document.foFrgTrd.bankBranch, document.foFrgTrd.bankName); } function fnLoadMsg(warning) { if(warning =='1'){ if (confirm("Not a valid bank-branch.\nAllow for free maintenance?")) { document.foFrgTrd.warningAcceptance="1"; } else{ document.foFrgTrd.warningAcceptance="0"; } } fnSettCurr(document.foFrgTrd.sett_ind); } //---------------- var bankRequestObj = null; function fnGetBankName1(bankCd, branchCd){ if (bankCd.length != 0){ bankRequestObj = ajaxInitRequest(bankRequestObj); var URL = "<%=request.getContextPath()%>/ajaxJsp/getBankName.jsp?bankCd="+bankCd+"&branchCd="+branchCd; bankRequestObj.open("GET", URL, true); bankRequestObj.onreadystatechange = setBankNameInnerHtml; bankRequestObj.send(null); } } function fnGetBankName(bank, branch){ var bankCd = bank.value; var branchCd = branch.value; if (bankCd.length != 0){ bankRequestObj = ajaxInitRequest(bankRequestObj); var URL = "<%=request.getContextPath()%>/ajaxJsp/getBankName.jsp?bankCd="+bankCd+"&branchCd="+branchCd; bankRequestObj.open("GET", URL, true); bankRequestObj.onreadystatechange = setBankNameInnerHtml; bankRequestObj.send(null); } } function setBankNameInnerHtml() { if (bankRequestObj.readyState == 4) { if(bankRequestObj.status == 200){ //document.getElementById("divBankName").innerHTML = bankRequestObj.responseText; var xmlDoc = bankRequestObj.responseXML; var bankNode = xmlDoc.getElementsByTagName("bankName")[0]; var bankName = bankNode.firstChild.nodeValue; if(bankName=='NaN'){ document.foFrgTrd.bankName.value = ''; document.getElementById("divBankName").innerHTML =' '; }else{ document.foFrgTrd.bankName.value =bankName; document.getElementById("divBankName").innerHTML =bankName; } } } } //---------------- function fnGetBranchInfo(bank, branch){ var bankCd = bank.value; var branchCd = branch.value; if (bankCd.length != 0 && branchCd.length!=0){ bankRequestObj = ajaxInitRequest(bankRequestObj); var URL = "<%=request.getContextPath()%>/ajaxJsp/getBranchInfo.jsp?bankCd="+bankCd+"&branchCd="+branchCd; bankRequestObj.open("GET", URL, true); bankRequestObj.onreadystatechange = setBranchInfoInnerHtml; bankRequestObj.send(null); } } function setBranchInfoInnerHtml() { if (bankRequestObj.readyState == 4) { if(bankRequestObj.status == 200){ var xmlDoc = bankRequestObj.responseXML; var bankNode = xmlDoc.getElementsByTagName("bankName")[0]; var bankName = bankNode.firstChild.nodeValue; if(bankName=='NaN'){ document.foFrgTrd.bankName.value = ''; document.getElementById("divBankName").innerHTML =' '; }else{ document.foFrgTrd.bankName.value =bankName; document.getElementById("divBankName").innerHTML =bankName; } var countryCdNode = xmlDoc.getElementsByTagName("countryCd")[0]; var countryCd = countryCdNode.firstChild.nodeValue; if(countryCd=='NaN'){ document.foFrgTrd.bankCountry.value = ''; }else{ document.foFrgTrd.bankCountry.value =countryCd; } var countryDescNode = xmlDoc.getElementsByTagName("countryDesc")[0]; var countryDesc = countryDescNode.firstChild.nodeValue; if(countryDesc=='NaN'){ document.foFrgTrd.countryDesc.value = ''; }else{ document.foFrgTrd.countryDesc.value =countryDesc; } if(countryCd=='NaN' && countryDesc=='NaN'){ document.getElementById("divCountry").innerHTML =' '; } else { document.getElementById("divCountry").innerHTML =countryCd +"-"+ countryDesc; } } } } //---------getBranchList--Not-in-use------- function AJAX(URL, callback) { listRequestObj = ajaxInitRequest(listRequestObj); listRequestObj.onreadystatechange=function() { if (listRequestObj.readyState==4 && listRequestObj.status==200) { callback(listRequestObj.responseText); } } listRequestObj.open("GET",URL,true); listRequestObj.send(); } function loadSomething() { var bankCd = document.foFrgTrd.bankCd.value; var branchCd = document.foFrgTrd.bankBranch.value; var URL = "<%=request.getContextPath()%>/ajaxJsp/getBankBranchList.jsp?bankCd="+bankCd+"&branchCd="+branchCd; window.timer=setTimeout(AJAX(URL, function (response) { document.getElementById("divBranch").innerHTML = response; }),3000); } //------------------------- function fnSettCurr(obj){ //document.foFrgTrd.frgncurr.value = document.foFrgTrd.defSett.value; //document.foFrgTrd.selectedSett.value = document.foFrgTrd.defSett.value; var settIn = get_radio_value(obj); if(settIn == 'L'){ document.getElementById("settCurrText").innerHTML = "<font face=Verdana size=2>Interim Currency <font color=#FF0000>*</font>:</font>"; document.getElementById("exRtText").innerHTML = "<font face=verdana size=2>Exchange Rate : <br><font size=1>(Traded >> Interim)</font></font>"; }else{ document.getElementById("settCurrText").innerHTML = "<font face=Verdana size=2>Foreign Settlement Currency <font color=#FF0000>*</font>:</font>"; document.getElementById("exRtText").innerHTML = "<font face=verdana size=2>Exchange Rate : <br><font size=1>(Traded >> Settlement)</font></font>"; } //if(document.foFrgTrd.settCurr.value == ''){ if(settIn == 'L'){ var currCode = document.foFrgTrd.currCode.value; //if error occurs and being redirect back from CMD, should follow back bean value <% if (errors != null && errors.length > 0) { %> currCode = '<%=bean.getDefSett()%>'; <%} %> document.foFrgTrd.settCurr.value = currCode; document.foFrgTrd.defSett.value = currCode; document.foFrgTrd.selectedSett.value = currCode; document.getElementById('frgncurr').disabled=true; ajaxGetSettCurr(); }else{ document.getElementById('frgncurr').disabled=false; ajaxGetSettCurr(); } //} /*var settIn = get_radio_value(obj); if (settIn =="L"){ document.getElementById('frgncurr').disabled=true; }else{ document.getElementById('frgncurr').disabled=false; } */ } function product_lookup() { this.p_item1 = arguments[0]; this.p_item2 = arguments[1]; this.p_item3 = arguments[2]; this.p_item2.focus(); vWinCal = window.open("../servlet/EOCentral?cmd=LookupCommand&subcmd=display-productlookup","searchWin","toolbar=no,scrollbars=yes,width=550,height=500"); vWinCal.moveTo(0,0); vWinCal.focus(); } // -------- market Curr ----------- // not in use var requestMarketCurr = null; function ajaxGetMarketCurr(){ if(document.foFrgTrd.mrktCd.value.length!=0){ requestMarketCurr = ajaxInitRequest(requestMarketCurr); var URL = "<%=request.getContextPath()%>/ajaxJsp/getMarketCurr.jsp?mrktcd=" + document.foFrgTrd.mrktCd.value; requestMarketCurr.open("GET",URL,true); requestMarketCurr.onreadystatechange = setInnerHtml; requestMarketCurr.send(null); } } function setInnerHtml(){ if(requestMarketCurr.readyState == 4){ if(requestMarketCurr.status == 200){ var xmlDoc = requestMarketCurr.responseXML; var node = xmlDoc.getElementsByTagName("mrktCurr")[0]; var currCd = node.firstChild.nodeValue; if(currCd=='NaN'){ }else{ document.foFrgTrd.currCode.value = currCd; } } } } //-------- Product Curr ----------- var requestProductCurr = null; function ajaxGetProductCurr(){ if(document.foFrgTrd.prodCd.value.length!=0 && document.foFrgTrd.mrktCd.value.length!=0 ){ requestProductCurr = ajaxInitRequest(requestProductCurr); var URL = "<%=request.getContextPath()%>/ajaxJsp/getProductCurr.jsp?mrktcd=" + document.foFrgTrd.mrktCd.value +"&prodcd=" + document.foFrgTrd.prodCd.value; requestProductCurr.open("GET",URL,true); requestProductCurr.onreadystatechange = setProdCurrInnerHtml; requestProductCurr.send(null); } } function setProdCurrInnerHtml(){ if(requestProductCurr.readyState == 4){ if(requestProductCurr.status == 200){ var xmlDoc = requestProductCurr.responseXML; var node = xmlDoc.getElementsByTagName("mrktCurr")[0]; var currCd = node.firstChild.nodeValue; if(currCd=='NaN'){ }else{ document.foFrgTrd.currCode.value = currCd; } var settIn = get_radio_value(document.foFrgTrd.sett_ind); fnSettCurr(document.foFrgTrd.sett_ind); } } } //-------- Sett Curr ----------- var requestSettCurr = null; function ajaxGetSettCurr(){ var settIn = get_radio_value(document.foFrgTrd.sett_ind); var arrKey = new Array (); if(document.foFrgTrd.fBroker.value.length!=0 && document.foFrgTrd.mrktCd.value.length!=0 && document.foFrgTrd.currCode.value.length!=0){ requestSettCurr = ajaxInitRequest(requestSettCurr); arrKey = document.foFrgTrd.fBroker.value.split(";") var strParam = "companyId=" + document.foFrgTrd.companyId.value +"&branchId=" + document.foFrgTrd.branchId.value +"&eafId=" + document.foFrgTrd.eafId.value +"&fBroker=" + arrKey[0] +"&frgBrkSbNo="+arrKey[1] +"&mrktcd=" + document.foFrgTrd.mrktCd.value+"&trdCurr=" + document.foFrgTrd.currCode.value; var URL = "<%=request.getContextPath()%>/ajaxJsp/getFrgBrkSettleCurr.jsp?" + strParam; requestSettCurr.open("GET",URL,true); requestSettCurr.onreadystatechange = setSettCurrInnerHtml; requestSettCurr.send(null); } } function setSettCurrInnerHtml(){ if(requestSettCurr.readyState == 4){ if(requestSettCurr.status == 200){ var xmlDoc = requestSettCurr.responseXML; var node = xmlDoc.getElementsByTagName("settCurr")[0]; var currCd = node.firstChild.nodeValue; if(currCd=='NaN'){ document.foFrgTrd.defSett.value = ""; }else{ document.foFrgTrd.defSett.value = currCd; } //fnSettCurr(document.foFrgTrd.sett_ind); document.foFrgTrd.frgncurr.value = document.foFrgTrd.defSett.value; document.foFrgTrd.selectedSett.value = document.foFrgTrd.defSett.value; } } } //-------- Exchange Rate ----------- var requestExRate = null; function getExchangeRate(){ var settCurr = document.foFrgTrd.settCurr.value; var trdCurr = document.foFrgTrd.currCode.value; if (trdCurr!="" && settCurr!="" && (trdCurr!=settCurr && settCurr!= "<%=defCurrency%>") ){ //Because the request values clash and cause errors across browsers, make a new one. requestExRate = ajaxInitRequest(requestExRate); var getExchangeURL = "<%=request.getContextPath()%>/ajaxJsp/getExchangeRate.jsp?currency="+trdCurr+"&trxDt="+document.foFrgTrd.trdDate.value+"&baseCurr="+settCurr; requestExRate.open("GET",getExchangeURL,true); requestExRate.onreadystatechange = setExchangeRate; requestExRate.send(null); } else document.foFrgTrd.exRate.value = ''; } function setExchangeRate(){ if(requestExRate.readyState == 4){ if(requestExRate.status == 200){ var xmlDoc = requestExRate.responseXML; var brokerTrx = ''; if(get_radio_value(document.foFrgTrd.trxcd) =='B'){ brokerTrx = 'brokerBuyRate'; }else{ brokerTrx = 'brokerSellRate'; } var exchangeRate = xmlDoc.getElementsByTagName(brokerTrx)[0]; if (exchangeRate!=null){ var exRate = exchangeRate.firstChild.nodeValue; document.foFrgTrd.exRate.value = exRate; } } } } function fnCancel(){ document.foFrgTrd.subcmd.value = "cancel"; document.foFrgTrd.submit(); } function fnSave(){ if(DatePosition(document.foFrgTrd.postDate, document.foFrgTrd.trdDate)){ alert("Transaction Value Date should not later than Posting Date."); Releasebuttons(document.foFrgTrd); }else{ document.foFrgTrd.parAcGrp.disabled=false; document.foFrgTrd.subcmd.value = "insert"; document.foFrgTrd.submit(); } } function fnShowHideOrdernoMandatory(obj) { var amalgInd = get_radio_value(obj); if (amalgInd == 'X') { document.getElementById("showOrderNoMandatory").style.display="" ; document.foFrgTrd.orderNo.disabled=false; <%-- document.foFrgTrd.orderNo.value= "<%= bean.getOrderNo() %>"; --%> } else { document.getElementById("showOrderNoMandatory").style.display="none"; document.foFrgTrd.orderNo.disabled=true; document.foFrgTrd.orderNo.value=""; } } function fnCallAjaxGetSettCurr(){ //when foreign broker is selected, settlement currency will be updated, but able to be overrided by select market-product //need to recall ajax after market-product being changed. if (document.foFrgTrd.fBroker.value != '' && document.foFrgTrd.mrktCd.value != ''){ ajaxGetSettCurr(); } } function display_addNewProduct() { this.p_item1 = arguments[0]; this.p_item2 = arguments[1]; vWinCal = window.open("../servlet/EOCentral?cmd=MaintainProductCommand&subcmd=displayfrgAddProd&mrktCd="+this.p_item1.value+"&prodCd="+this.p_item2.value,"searchWin","toolbar=no,scrollbars=yes,status=yes,width=750,height=450"); vWinCal.moveTo(0,0); vWinCal.focus(); } function fnConfirm() { if(<%= chkExt%>){ $.prompt('This product NOT EXIST in MARKET. Do you want to create new product?',{ buttons:[ {title: 'Yes',value:true}, {title: 'No',value:false} ], focus: 1, submit: function(e,v,m,f){popupWin(v);} }); } } function popupWin(val) { if(val==true) { vWinCal = window.open("../servlet/EOCentral?cmd=MaintainProductCommand&subcmd=displayfrgAddProd&mrktCd="+document.foFrgTrd.mrktCd.value+"&prodCd="+document.foFrgTrd.prodCd.value,"searchWin","toolbar=no,scrollbars=yes,status=yes,width=750,height=450"); vWinCal.moveTo(0,0); vWinCal.focus(); }else{ Releasebuttons(document.foFrgTrd); } } </script> </head> <body bgcolor=#FFFFFF onload="javascript:fnLoadMsg('<%= warning %>');fnShowHideOrdernoMandatory(foFrgTrd.amalg_ind);fnConfirm();"> <form name="foFrgTrd" method="post" action="EOCentral"> <div align=left> <table width="100%"> <tr> <td><div class="title"><div class="title_l"><div class="title_r"> <div class="rc_content"> Foreign Trade Maintenance</div> </div></div></div></td> </tr> <tr> <td> </td> </tr> <tr> <td height="25"><div class="main"><div class="main_l"><div class="main_r"> <div class="rc_content">Enter Foreign Trade</div> </div></div></div></td> </tr> </table> </div> <input type="hidden" name="cmd" value="MaintainForeignTradeCommand"> <input type="hidden" name="subcmd" value=""> <input type="hidden" name="companyId" value="<%=companyId%>"> <input type="hidden" name="branchId" value="<%=branchId%>"> <input type="hidden" name="eafId" value="<%=eafId%>"> <input type="hidden" name="rcdVersion" value="0"> <input type="hidden" name="warningAcceptance" value="<%= warning%>"> <% if (errors != null && errors.length > 0) { %> <!-- <p align="left"> <b><font color="#CC0000">Please Correct the Following Errors:</font></b> </p> --> <div align="left"> <ul> <% for (int i=0; i<errors.length; i++) { %> <li><font color="#CC0000"><%=errors[i]%></font> </li> <% } %> </ul> </div> <p></p> <% } %> <table width="70%" align="center"> <tr> <td><div align="right"><font face="Verdana" size="2">Posting Date<font color="#FF0000">*</font>: </font></div> </td> <td><font face="Verdana"> <input type="text" name="postDate" maxlength="10" size="15" value="<%=bean.getPostDate() %>" readonly style="background-color:#E8E8E8"> </font></td> </tr> <tr> <td><div align="right"><font face="Verdana" size="2">Trade Date<font color="#FF0000">*</font>: </font></div> </td> <td><font face="Verdana"> <input type="text" name="trdDate" maxlength="10" size="15" value="<%=bean.getTrdDate() %>" onChange="CheckDate(this)" onKeyDown="FormatDate(this, window.event.keyCode,'down')" onKeyUp="FormatDate(this, window.event.keyCode,'up')"> <a href="javascript:show_calendar('foFrgTrd.trdDate');" onMouseOver="window.status='Date Picker';return true;" onMouseOut="window.status='';return true;"><img border="0" name="calFrom" src="../images/show-calendar.gif" width="24" height="22"></a> </font></td> </tr> <!-- <tr> <td nowrap><div align="right"><font face="Verdana" size="2">Order Ref<font color="#FF0000">*</font>: </font></div></td> <td nowrap><font face="Verdana" size="2"> </font></td> </tr> --> <input type="hidden" name="orderRef" maxlength="10" size="15" value="<%=bean.getSeqNum() %>" > <tr> <td nowrap><div align="right"><font face="Verdana" size="2">Market-Product<font color="red">*</font>:</font></div></td> <td nowrap><font face="Verdana" size="2"> <!--<input type="text" name="mrktCd" maxlength="4" size="6" value="<%=bean.getMrktCd() %>" onBlur="javascript:ajaxGetMarketCurr(),ajaxGetSettCurr()"> --> <input type="text" id="mrktcdRd" name="mrktCd" maxlength="4" size="6" value="<%=bean.getMrktCd() %>" onBlur="javascript:ajaxGetProductCurr()" > <input type="text" id="prodcdRd" name="prodCd" maxlength="10" size="12" value="<%=bean.getProdCd() %>" onBlur="javascript:ajaxGetProductCurr();setTimeout(function() {fnCallAjaxGetSettCurr()}, 500)" > <a href="javascript:foreignProduct_lookup(foFrgTrd.mrktCd, foFrgTrd.prodCd, foFrgTrd.prodDesc)">LookUp</a> <a href="javascript:display_addNewProduct(foFrgTrd.mrktCd, foFrgTrd.prodCd)" >Add New Product</a> </font> <%= bean.getErrMsg()!=null ? bean.getErrMsg().trim() : ""%></td> </tr> <tr> <td></td> <td nowrap><font face="Verdana" size="2"> <input name="prodDesc" style="border: 0px" value="<%=bean.getProductName()%>" size="60" readonly="readonly"> </font></td> </tr> <tr> <td nowrap> <div align="right" nowrap><font face="Verdana" size=2>Traded Currency :</font></div> </td> <td nowrap><font face="Verdana" size=2> <input type="text" name="currCode" maxlength="4" size="6" value="<%= bean.getCurrCode() %>" readonly> <%-- <select name="currCode" style="width: 300" onChange="javascript:ajaxGetSettCurr(),getExchangeRate()"> <option value="" <%=bean.getCurrCode().trim().equals("") ? "selected":""%>></option> <% for(int i=0;i<currencyList.length;i++) { curr=currencyList[i]; %> <option value="<%= curr.getCurrCode() %>" <%=bean.getCurrCode().trim().equals(curr.getCurrCode()) ? "selected":""%>> <%= curr.getCurrCode() %>-<%= curr.getDescriptn() %></option> <% } %> </select> --%> </font></td> </tr> <tr> <td nowrap><div align="right"><font face="verdana" size="2">Traded Price<font color="red">*</font>:</font></div></td> <td nowrap><font face="Verdana" size="2"> <input type="text" name="trdPrice" maxlength="15" size="17" value="<%= format.format(FormUtil.returnDouble(bean.getTrdPrice()),6,1,0) %>" onKeyDown="javascript:callDecimal(this,8)" onkeypress="return checkDecimal(this, 6);"> </font></td> </tr> <tr> <td width="32%" nowrap> <div align="right"><font face="Verdana" size="2">Trx-Code<font color="#FF0000">*</font>:</font></div> </td> <td colspan="3"> <input type="radio" name="trxcd" value="B" <%= (bean.getBuySell().equals("B")||bean.getBuySell().equals(""))? "checked": "" %> onClick="getExchangeRate()"> Buy <input type="radio" name="trxcd" value="S" <%= bean.getBuySell().equals("S")? "checked": "" %> onClick="getExchangeRate()"> Sell </td> </tr> <tr> <td nowrap><div align="right"><font face="verdana" size="2">Quantity<font color="red">*</font>:</font></div></td> <td nowrap><font face="Verdana" size="2"> <input type="text" name="quantity" maxlength="9" size="14" value="<%= bean.getTrdQty() %>" onkeypress="return checkDecimal(this, 0);"> </font></td> </tr> <tr> <td nowrap><div align="right"><font face="Verdana" size="2">Account No<font color="red">*</font>:</font></div></td> <td nowrap><font face="Verdana" size="2"> <input type="text" name="acctNo" maxlength="26" size="30" value="<%= bean.getAcctNo() ==""? bean.getFullAcctNo():bean.getAcctNo()%>"> <input type="text" name="parAcGrp" value="<%= bean.getParAcGrp() %>" readOnly=true size="6" disabled> <a href="javascript:outbnd_account_lookup(foFrgTrd.acctNo, '', '', '', foFrgTrd.acctName,foFrgTrd.parAcGrp);">Lookup</a> </font></td> </tr> <tr> <td></td> <td nowrap><font face="Verdana" size="2"> <input name="acctName" style="border: 0px" value="<%=bean.getAcctName()%>" size="60" readonly="readonly"> </font></td> </tr> <tr height="28"> <td nowrap> <div align="right"><font face="Verdana" size=2>Foreign Broker<font color="#FF0000">*</font>:</font></div></td> <td nowrap> <select name="fBroker" style="width:100px;" onChange="javascript:ajaxGetSettCurr()"> <option value="" <%=bean.getFrgBroker().trim().equals("") ? "selected":""%>></option> <% for (int i=0; i < fbList.length; i++) { acmast = fbList[i]; %> <option value="<%=acmast.getAcctNo()%>;<%=acmast.getAcctSbNo()%>" <%=bean.getFrgBroker().trim().equals(acmast.getAcctNo()) ? "selected":""%>> <%=acmast.getAcctNo()%></option> <% } %> </select> </td> </tr> <tr> <td width="32%" nowrap> <div align="right"><font face="Verdana" size="2">Settlement In<font color="#FF0000">*</font>:</font></div> </td> <td colspan="3"> <input type="radio" name="sett_ind" value="L" <%=bean.getSettCurInd().equals("L") ? "checked":"" %> onClick="javascript:fnSettCurr(foFrgTrd.sett_ind)"> MYR <input type="radio" name="sett_ind" value="" <%= bean.getSettCurInd().equals("") ? "checked": "" %> onClick="javascript:fnSettCurr(foFrgTrd.sett_ind)"> OTHERS <!-- <input type="radio" name="sett_ind" value="L" <%//=bean.getSettCurInd().equals("L") ? "checked":"" %>> Local <input type="radio" name="sett_ind" value="" <%//= bean.getSettCurInd().equals("") ? "checked": "" %>> Foreign --></td> </tr> <tr height="28"> <td align="right" nowrap> <div id="settCurrText"><font face="Verdana" size=2>Foreign Settlement Currency <font color="#FF0000">*</font>:</font></div> </td> <td nowrap><font face="Verdana" size=2> <input type="hidden" name="defSett" value="<%=bean.getDefSett()%>"> <input type="hidden" name="selectedSett" value="<%=bean.getSettCurr()%>"> <!--<select id ="frgncurr" name="settCurr" style="width: 300" <//%=(bean.getSettCurInd().equals("L"))? "disabled":""%> onChange="javascript:foFrgTrd.selectedSett.value=this.value;getExchangeRate()">--> <select id ="frgncurr" name="settCurr" style="width: 300" onChange="javascript:foFrgTrd.selectedSett.value=this.value;getExchangeRate()"> <option value=""></option> <% for(int i=0;i<currencyList.length;i++) { curr=currencyList[i]; if (!curr.getCurrCode().trim().equals(defCurrency)){ %> <option value="<%= curr.getCurrCode() %>" <%=bean.getSettCurr().trim().equals(curr.getCurrCode()) ? "selected":""%>> <%= curr.getCurrCode() %>-<%= curr.getDescriptn() %></option> <% } }%> </select> </font></td> </tr> <tr style="display:none"> <td align="right" nowrap><div id="exRtText"><font face="verdana" size="2">Exchange Rate : <br><font size="1">(Traded >> Settlement)</font></font></div></td> <td nowrap><font face="Verdana" size="2"> <input type="text" name="exRate" maxlength="11" size="14" value="<%= format.format(FormUtil.returnDouble(bean.getExchgsCur()),6,1,0) %>"> </font></td> </tr> <!-- hide the field for retail user <tr> <td nowrap><div align="right"><font face="Verdana" size="2">Brokerage Rate Overridden <br><font size="1">(Acc Parent Grp: <%=frgIssGrp %>) : </font></font></div></td> <td nowrap><font face="Verdana" size="2"> <input type="text" id="brokerage" name="brokerage" maxlength="11" size="14" value="<%= bean.getOvrBrkgRt()==0? "":format.format(bean.getOvrBrkgRt(),6,1,1) %>" onKeyDown="javascript:callDecimal(this,4)" onKeyPress="return checkDecimal(this,6)"> % (Minimum B2B Brokerage still apply) </font></td> </tr> --> <tr> <td nowrap><div align="right"><font face="Verdana" size="2">Enter By : </font></div></td> <td nowrap><font face="Verdana" size="2"> <input type="text" name="usrCreated" value="<%=bean.getUsrCreated()%>" disabled> </font></td> </tr> <tr> <td nowrap><div align="right"><font face="Verdana" size="2"> </font></div></td> <td nowrap><font face="Verdana" size="2"> </font></td> </tr> <tr> <td nowrap><div align="right"><font face="Verdana" size="2">Bank : </font></div></td> <td nowrap><font face="Verdana" size="2"> <input type="text" name="bankCd" value="<%= bean.getBankCd()%>" maxlength="4" size="6" onblur="javascript:fnGetBankName(this,foFrgTrd.bankBranch);"> <input type="text" id="textbranch" name="bankBranch" maxlength="10" value="<%= bean.getBankBranch()%>" onblur="javascript:fnGetBranchInfo(foFrgTrd.bankCd, this);"> <a href="javascript:ajaxBank_lookup()">LookUp</a> </font></td> </tr> <tr> <td nowrap><div align="right"><font face="Verdana" size="2">Bank Name : </font></div></td> <td nowrap><font face="verdana" size="2"> <div id="divBankName"><%= bean.getBankName() %></div> <input type="hidden" name="bankName" value="<%= bean.getBankName() %>" maxlength="40" size="45"></font></td> </tr> <tr> <td nowrap><div align="right"><font face="Verdana" size="2">Country : </font></div></td> <td nowrap><font face="Verdana" size="2"><div id="divCountry"><%= bean.getBankCountry() %><%= bean.getCountryDesc().isEmpty()?"": "-"+bean.getCountryDesc() %></div> <input type="hidden" name="bankCountry" maxlength="3" size="6" value="<%= bean.getBankCountry() %>"> <input type="hidden" name="countryDesc" size="6" value="<%= bean.getCountryDesc() %>"></font> </td> </tr> <tr> <td nowrap><div align="right"><font face="Verdana" size="2">Bank Account Number: </font></div></td> <td nowrap><font face="Verdana" size="2"> <input type="text" name="bankAcct" maxlength="20" value="<%= bean.getBankAcct() %>"> </font></td> </tr> <tr> <td nowrap><div align="right"><font face="Verdana" size="2">SWIFT Code : </font></div></td> <td nowrap><font face="Verdana" size="2"> <input type="text" name="swiftRef" maxlength="20" value="<%= bean.getSwiftRef() %>" > </font></td> </tr> <tr> <td nowrap><div align="right"><font face="Verdana" size="2">Partial Contract Trade : </font></div></td> <td nowrap><font face="Verdana" size="2"> <input type="radio" name="amalg_ind" value="X" onClick="javascript:fnShowHideOrdernoMandatory(foFrgTrd.amalg_ind)" <%= bean.getAmalgInd().equals("X") ? "checked":"" %> > Yes <input type="radio" name="amalg_ind" value="" onClick="javascript:fnShowHideOrdernoMandatory(foFrgTrd.amalg_ind)" <%= bean.getAmalgInd().equals("") ? "checked": "" %> > No </font></td> </tr> <tr> <td nowrap><div align="right"><font face="Verdana" size="2">Order Number<span id="showOrderNoMandatory"><font color="#FF0000">*</font></span>: </font></div></td> <td nowrap><font face="Verdana" size="2"> <input type="text" name="orderNo" maxlength="20" size="25" value="<%= bean.getOrderNo() %>" > </font></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td nowrap><div align="right"><font face="Verdana" size="2">Remarks : </font></div></td> <td nowrap><font face="Verdana" size="4"> <input type="text" name="remark" maxlength="20" size="30" value="<%= bean.getRemark() %>" > </font></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"> <div align="center"> <input type=button value=" Save " onClick="javascript:Lockbuttons(this.form);fnSave()" name="btnSave"> <input type=button value=" Cancel " onClick="javascript:Lockbuttons(this.form);fnCancel()" name="btnCancel"> </div> </td> </tr> </table> </form> </body> </html>
Dave Tolls
Rancher
Posts: 4801
50
posted 8 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
That is a huge amount of code to look through.
I can't imagine it's all needed to show us the issue you have.
Can you shrink it down to the relevant parts?
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
How to define value at second page
Value undefined
how to insert data at window parent after data insert popup window
How to refresh popup screen and coding can't unload
Question on jQuery ajax functionality & troubleshooting called bean in JSF page
More...