• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
deva siva
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • 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++)

{

-------

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



}
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Here MyMethod1 is getLOB
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript can not use a Java function.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic