Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 27th, 2007, 08:14 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to convert this to JSP?

The following works properly on the command prompt....I want to encapsulate this into a function defined in a jsp page & call it Populate(accID) which i can call ont he click event of a button;


ArrayList list = (ArrayList)getMLSAccInfo(100);
         int size = list.size();
         MLSAccountBean bean;

             for (int i=0; i<size; i++) {
              bean = (MLSAccountBean)list.get(0);

              System.out.println(bean.getEntity_id());
              System.out.println(bean.getFid());
              System.out.println(bean.getFund_sup());
              System.out.println(bean.getFund_admin());
              System.out.println(bean.getTerm_date());
              System.out.println(bean.getBase_ccy());
              System.out.println(bean.getAlt_ccy());
              System.out.println(bean.getAutoperf());
             }


------------------------------------------------------------
this is what I tried do & the page doenst get displayed anymore:=
onClick event of Get Data button -> Populate(this.form.accNum)


<script language="JavaScript">
function populate(accID){
<jsp:useBean id=resultBean class="MLSAccountBean" scope="request"/>
<%
           ArrayList list = (ArrayList)getMLSAccInfo(100);

           int size = list.size();
         MLSAccountBean bean;
            bean = (MLSAccountBean)list.get(-);

%>
    document.getElementById('txtFund_admin').value=<%= bean.getFund_admin()%>;
 document.getElementById('txtFund_sup').value=<%=be an.getFund_sup()%>;
 document.getElementById('txtFid').value=<%=bean.ge tFid()%>;
 document.getElementById('txtPcd').value=<%=bean.ge tPcd()%>;
 document.getElementById('txtTerm_date').value=<%=b ean.getTerm_date()%>;
 document.getElementById('txtBase_ccy').value=<%=be an.getBase_ccy()%>;
 document.getElementById('txtAlt_ccy').value=<%=bea n.getAlt_ccy()%>;
 if(<%=bean.getAutoperf()%> == 'Y')
  document.getElementById('cbAuto').checked="yes";
 else
  document.getElementById('cbAuto').checked="no";
}




Can somebody help me on this JSP thing?
Thanks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help to convert c++ to c# happy_face C# 2 November 9th, 2007 10:56 PM
how to convert ???? bobolov Classic ASP Basics 2 June 15th, 2006 12:58 PM
Please Help. mr_newreq.jsp:78: jsp:useBean can't f batken JSP Basics 0 February 22nd, 2006 09:56 PM
CONVERT Adam H-W SQL Server ASP 5 September 24th, 2004 10:53 AM
convert ngang SQL Server 2000 7 November 21st, 2003 06:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.