• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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
  • 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
  • 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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript can not use a Java function.
 
author
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.
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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,
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic