[flexcoders] Problem with contains method of ArrayCollection

2006-05-11 Thread mbordallo



hi all!!

i'm trying to use the contains method of an arraycollection component,
but i get the following error messages:

1.Attempted access of inaccessible property contains through a
reference with static type myComp:UserList.
2.Call to a possibly undefined method contains.


i've tryed it in flex 2 beta 2 and beta 3 and get the same error.

can someone help me know the reason of this error?


thanks



Manuel Bordallo











--
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
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] Re: Error when i try to get information from a dataservice to populate my datagr

2006-03-15 Thread mbordallo



Thank you very much Matt.I have resolved the problem. It was more simple as it seem.The identity property idusuario I defined in the dataservice (flex-data-service.xml) was empty when I call my java code, so when I get the dataservice result it says :Error: Item requested at index 0 was null and should not have been. Error for service 'usuario'Now, I'm trying to know why this field is coming back empty from the database query, and I'm using another field to define the identity property in the dataservice.Thanks for your response.--Manuel Bordallo






--
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
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









[flexcoders] Error when i try to get information from a dataservice to populate my datagrid

2006-03-14 Thread mbordallo



Hi, i'm trying to create a dataservice to conect a database with my datagrid, but i get this errorError: Item requested at index 0 was null and should not have been. Error for service 'usuario'	at mx.data::DataList/http://www.macromedia.com/2005/flex/mx/internal::requestItemAt()	at mx.data::DataList/getItemAt()	at mx.collections::ListCollectionView/getItemAt()	at mx.collections::ListCollectionViewCursor/seek()	at mx.controls.listclasses::ListBase/modelChanged()	at mx.controls::DataGrid/modelChanged()	at flash.events::EventDispatcher/dispatchEvent()	at mx.collections::ListCollectionView/dispatchEvent()	at mx.collections::ListCollectionView/http://www.macromedia.com/2005/flex/mx/internal::reset()	at mx.collections::ListCollectionView/mx.collections:ListCollectionView::listChangeHandler()	at flash.events::EventDispatcher/dispatchEvent()	at mx.data::DataList/http://www.macromedia.com/2005/flex/mx/internal::processSequenceResult()	at C:\dev\enterprise_beta1\frameworks\mx\data\errors\DataServiceError.as$34::DataListRequestResponder/result()	at mx.rpc::AsyncRequest/acknowledge()	at C:\dev\enterprise_beta1\frameworks\libs\framework.swc(mx/core/mx_internal)$35::NetConnectionMessageResponder/result()I'm using:Windows XP servicepack 2Mozilla Firefox 1.5 (i've also tryed ie, but i get the same error)Flex 2.0 beta 1Flex Enterprise Services 2.0 beta 1Flash Player 8.5 Alpha 3 (build 211)
ListaUsuarios.mxmlimport mx.collections.ArrayCollection;	import mx.data.DataService;		public var ds:DataService;		[Bindable]		public var usuarios:ArrayCollection;		public function initApp()		{ usuarios = new ArrayCollection(); ds = new DataService("usuario"); ds.fill(usuarios);		}	
flex-data-service.xmlserviceadaptersadapter-definition id="actionscript"  class="flex.data.adapters.ASObjectAdapter" default="true"/adapter-definition id="java-dao" class="flex.data.adapters.JavaAdapter"//adaptersdefault-channelschannel ref="my-rtmp"//default-channelsdestination id="usuario" adapter ref="java-dao" /propertiesmetadataidentity property="idusuario"//metadatanetworksession-timeout0/session-timeoutpaging enabled="false" /throttle-inbound policy="ERROR" max-frequency="500"/throttle-outbound policy="REPLACE" max-frequency="500"//networkserverassemblerclassusuarios.UsuarioAssembler/classsingletontrue/singleton/assemblerfill-methodnameloadUsuarios/name/fill-method/server/properties/destination/service
UsuarioAssembler.javapackage usuarios;import java.util.List;public class UsuarioAssembler{	public List loadUsuarios()	{		UsuarioDAO dao = new UsuarioDAO();		return dao.getUsuarios();	}}UsuarioDAO.javapackage usuarios;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import java.util.ArrayList;import java.util.List;public class UsuarioDAO{	public List getUsuarios() throws DAOException	{		ArrayList list = new ArrayList();		Connection c = null;		try		{			c = ConexionBD.getConexion();			Statement s = c.createStatement();			ResultSet rs = s.executeQuery("SELECT * FROM alumnos ORDER BY nombre");			Usuario usuario;			while (rs.next())			{usuario = new Usuario();usuario.setIdUsuario(rs.getString("id_usuario"));usuario.setPassword(rs.getString("password"));usuario.setNombre(rs.getString("nombre"));list.add(usuario);			}		}		catch (SQLException e)		{			e.printStackTrace();			throw new DAOException(e);		}		finally		{			ConexionBD.cerrarConexion(c);		}		return list;	}}Everything in java works correctly, but when i try to call it from flex doesn't work.If anybody can help me, i will be very pleased.Thanks in advance.--Manuel Bordallo[EMAIL PROTECTED]






--
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
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.