0 Replies Latest reply on May 21, 2009 9:17 AM by Manish Prajapati

    Sending Javascript Nested Arrays object to seam remote method using seam remoting but getting NULL in remote method

    Manish Prajapati Newbie
      Hi All,

      I am trying to send Javascript Arrays containing Arrays to seam remote method but in seam remote method i am getting it NULL.

      Following is my code snippets:

      XHTML Code:
      <s:remote include="decisionTableManager"/>
      function testMe(){
           var columnAndRowArray=null;
           var columnsArray;
           var columns=theTable.tHead.rows[1];
           columnsArray=new Array(columns.cells.length);
           for(var i=0;i<columns.cells.length;i++){
           var allRows=theTable.tBodies[0].rows;
           var rowsArray=new Array(allRows.length);
           var rowLength=allRows.length;
           for(var i=0;i<rowLength;i++)
                var rows=new Array(allRows[i].cells.length);
                var cellsLength=allRows[i].cells.length-1;
                for(var j=1;j<cellsLength;j++)
                     var hiddenFieldId="hidden"+i+j;
           columnAndRowArray=new Array();
           var listMap=new Seam.Remoting.Map();
      //Here in place of listMap i have also tried by passing columnAndRowArray array and in testMe parameter type i put Object[] but in that case also i am getting NULL.

      Interface :

      public interface TestTableManager {
           public boolean saveToXLS(Map<String,Object[]> listMap);
           public void remove();

      Concrete Class:

      public class TestTableManagerBean implements TestTableManager   {     

           public boolean testMe(Map<String,Object[]> listMap){
                System.out.println("***** saveToXLS is called *****");
                System.out.println("****** Printing details *********");
                try {
                     String [] columns=(String[])listMap.get("columnList");
                     Object [] rows=(Object[])listMap.get("rowList");
                     List<String> columnList=Arrays.asList(columns);
                     System.out.println("************Column List is as given below *********");
                     List<List<String[]>> rowList=new ArrayList<List<String[]>>();
                     System.out.println("**** Each Rule List *****");
                     for(int i=0;i<rows.length;i++){
                          List<Object> eachRuleRowList=(List<Object>)Arrays.asList(rows[i]);
                } catch (Exception e) {
                     // TODO Auto-generated catch block
                return true;

      Can anybody tell me how i can accomplish my goal of passing Javascript Array of Arrays to testMe() remote method and get Actual values instead of NULL.

      Thanks in advance.