• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to pass the values and how to get the Arraylist table from java script function

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

how to pass the values and how to get the Arraylist table from java script function.

we have one java class file, that contains the method1 and it returs the ArrayList Table.

My java class contains the ArrayList, like

Class A
---------------
public ArrayList getMethod1(String val1,String val2)throws NoResults
{
ArrayList SUBLOBTable=new ArrayList();
some database code here
----
-------------
return SUBLOBTable;
}

IN My JSP : we create a obj for that.
--------------------
ClassA Obj = new ClassA();

Now my question like �how to access that SUBLOBTable from javascript�

IN javascript

----------------------------------
var jsObj = "<%=Obj%>"; //i creaate a var which contains the obj of that ClassA file

var mylist = new Array();

mylist = jsObj.getLOB(GRP_Type,LOBL); //it gives the object doesnot support this property or method.

var s1=mylist.size();

for (i=0;i<s1;i++)

{

-------

--------------



}
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like getLOB is not in your JavaScript code, or you have it defined after the statement when it needs to be listed before it.

Eric
 
deva siva
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here MyMethod1 is getLOB
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JavaScript can not use a Java function.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this thread to the JSP forum, which is closer to the topic.
Please continue the discussion over there. Thanks.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eric Pascarello:
JavaScript can not use a Java function.



Please read this article for an explanation why,
 
reply
    Bookmark Topic Watch Topic
  • New Topic