Hi All,
        Is it possible to send a DataProvider, created dynamically in action
script, back to server? This is what I am trying to accomplish....
In my mxml file I make a RO call to java class and java class returned an
array of VOs. I stored them in an action script variable called price_do.
Then I created a DataProvider object using
createClassObject(DataProvider,"myDP",1); and then assigned price_do to
myDP.dataprovider. I am doing this because user want to see the retrieved
info in a free form format not a grid format. Once user click save button on
the screen I am getting values from individual textinputs and update the
myDP object using myDP.editField( ) method and invoke a remote method to
send this dataProvider object back to my java class. 

I am having problems in the last step- sending dataprovider to java class. I
have system print outs in my java class and none got executed. It looks like
object passed back to java class is not recognized as array of VOs. Please
some one help me out. I am attaching my mxml and java class for your
reference. Thanks in advance..


 <<schedPrice.mxml>>  <<save.txt>> 
Thanks!
Hari



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Attachment: schedPrice.mxml
Description: Binary data

public static String saveSchedPrice(SchedPriceVO[] schedPriceVOArray) throws 
SQLException
  {
    Connection conn = null;
    PreparedStatement stmt = null;

    int itemsid;
    String irm;
    String price;
    SchedPriceVO schedPriceVO;
    System.out.println("from DAO Save  ");
    try
    {
      conn = ConnectionPool.getConnection();
      System.out.println("DAO Save  array length "+schedPriceVOArray.length);
      System.out.println("array is  : "+schedPriceVOArray);
      System.out.println("array string is  : "+schedPriceVOArray.toString());
      System.out.println("array class is  : "+schedPriceVOArray.getClass());

      for(int x=0;x<schedPriceVOArray.length;x++)
      {
        schedPriceVO = new SchedPriceVO();
        schedPriceVO = schedPriceVOArray[x];
        System.out.println("x : "+x);
        //itemsid = schedPriceVO.getItemSid();
        irm     = schedPriceVO.getIrmonth();
        System.out.println(" 1 ");
        price   = schedPriceVO.getPrice();
        System.out.println(" 2 ");
        itemsid  = 1168960;
        System.out.println("price : "+price+"  irm  : "+irm);

        StringBuffer strBuffer = new StringBuffer("update work_item_price ");
        strBuffer.append("set REPORTED_PRICE1 = "+price+" ");
        strBuffer.append("where ITEM_SID = "+itemsid+" ");
        strBuffer.append("and IRM = '"+irm+"'");
        String sqlString = strBuffer.toString();

        System.out.println("sqlString : "+sqlString);
        stmt = conn.prepareStatement(sqlString);
        stmt.executeQuery();
        System.out.println("update is successful "+x);
      }
      return "Update Succesful";
    }
    catch(SQLException ex)
    {
      ex.printStackTrace();
      throw new SQLException(ex.getMessage());
    }
    finally
    {
      try
      {
        if (stmt != null)
        {
          stmt.close();
        }
        if (conn != null)
        {
          conn.close();
        }
      }
      catch (Exception ex)
      {
        // non-fatal; only closing if pooled.
        // don't overthrow original exception
        System.out.println("from SchedAdjDAO Closing exception : 
"+ex.getMessage());
      }
    }

  }

Reply via email to