I don’t trust this:

result="list=event.result

 

Instead, call a handler function so that you can debug the contents of result:

Result=”onResult(event)”

 

private function onResult(oEvent:ResultEvent):void

 trace(oEvent.result.toXMLString()); //this actually will depend on the data type in the result object

 

Tracy

 


From: [email protected] [mailto:[email protected]] On Behalf Of RAMANA
Sent: Tuesday, October 24, 2006 10:55 AM
To: [email protected]
Subject: [flexcoders] remote object help

 

hai everybody,
i am new to flex environment and i am presently working on remote
object service.
in this regard i need a help,
i am trying to retrieve values from sql and output them to datagrid,
i am unable to see the values outputed to datagrid
my sql db contains two columns cname and email, and i am working on
flex 1.5
here is my mxml,as,java file to solve the above problem.

LoginchkAB.java

import java.sql.*;
import java.util.ArrayList;
public class LoginchkAB{
Connect q=new Connect();
public void LoginchkAB()
{

}
public ArrayList getList()
{
ArrayList list = new ArrayList();
try
{
Connection Conn=q.establish_Connection();
Statement s = Conn.createStatement();
ResultSet rs= s.executeQuery("select cname,email from
deepa123456");
System.out.println("ramana");

while (rs.next
()) {
list.add(new ViewuserVO
(rs.getString(1),rs.getString(2)));
System.out.println("ramana");
}

s.close();
Conn.close();
}
catch(Exception e)
{
System.out.println("TechRP"+e);
}
return list;
}
public static void main(String args[])
{
LoginchkAB q=new LoginchkAB();

}
}

ViewuserVO.as file

class ViewuserVO {
public var cname : String;
public var email : String;


static var registered=Object.registerClass("ViewuserVO",
ViewuserVO);
}

UsingRemoteObj1.mxml

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
verticalGap="10">
<mx:Button label="Get user List" click="getusers()"/>


<mx:DataGrid id="dg" dataProvider="{loginchkA.list}" width="100%"
height="100%">
<mx:columns>
<mx:Array>
<mx:DataGridColumn columnName="cname"
headerText="cname" />
<mx:DataGridColumn columnName="email"
headerText="email"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
<mx:Script>
var list;

</mx:Script>
<mx:Script>
<![CDATA[
function getusers()
{
loginchkA.getList();
}
]]>
</mx:Script>

<mx:RemoteObject id="loginchkA" result="list=event.result"
source="LoginchkAB" fault="alert(event.fault.faultstring, 'Error')">
<mx:method name="getList"/>
</mx:RemoteObject>
</mx:Application>

i would be thankful for the help regarding this.

Thank u all
Ramana

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to