Codido del Componente que esta en
src - > components - > combocomponents
[color=]
Código :
<mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();"
labelField="nombre">
<mx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
public function init():void
{
remoteProducto.getAllRows();
}
private function error(e:FaultEvent):void
{
Alert.show(e.fault.message,'Error! O_o');
}
private function getProductos(e:ResultEvent):void
{
this.dataProvider = e.result;
}
]]>
</mx:Script>
<mx:RemoteObject id="remoteProducto"
destination="GenericDestination"
source="sistemarossi.dao.ProductoDAO"
showBusyCursor="true"
result="getProductos(event)"
fault="Alert.show(event.fault.message,'Error! O_o')"/>
</mx:ComboBox>Codigo del Componenete que llama al Componente anterior
Este se encuentra en:
src - > components
Código :
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" label="Producto"
xmlns:comp="comboComponents.*" xmlns:comboComponents="components.comboComponents.*">
<mx:Script>
<![CDATA[
import mx.messaging.AbstractConsumer;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.events.ValidationResultEvent;
private function insertProducto():void
{
var nombre:String = text_nombre.text;
var medida:int = list_medidas_crear.selectedItem.id;
var clase:int = list_clases_crear.selectedItem.idclase;
var desc:String = text_descipcion.text;
remoteProducto.insert(nombre,medida,clase,desc);
}
private function reloadpage():void
{
var ref:URLRequest = new URLRequest("javascript:location.reload(true)");
//var ref:URLRequest = new URLRequest(this.);
// navigateToURL(ref, "_self");
var u:URLRequest = new URLRequest();
Alert.show(ref.requestHeaders.toString(),"la url");
}
//Esta es la funcion que llamo para recargar el combobox
private function recargarCombo():void
{
list_productos_edit.init();
}
private function buscarProductoEdit(e:MouseEvent):void
{
text_nombre_edit.text = list_productos_edit.selectedItem.nombre;
list_medidas_edit.selectedIndex = list_productos_edit.selectedItem.nombre;
Alert.show(list_productos_edit.selectedItem.idproducto,"medida");
list_clases_edit.selectedItem.idclase = list_productos_edit.selectedItem.idclase;
}
]]>
</mx:Script>
<mx:RemoteObject id="remoteProducto"
destination="GenericDestination"
source="sistemarossi.dao.ProductoDAO"
showBusyCursor="true"
result="Alert.show(event.result.toString(),'Exito!! insertando');"
fault="Alert.show(event.fault.message,'Error! O_o')"/>
<mx:TabNavigator id="producto" width="100%" height="100%" change="tab(event);">
<!-- TAB EDICION DE PRODUCTO -->
<mx:Panel id="edit" label="Editar" layout="horizontal">
<mx:VBox>
<mx:Form>
<mx:FormHeading label="Edicion de Productos"/>
<mx:FormItem label="Nombre:" required="true" >
<mx:TextInput id="text_nombre_edit"/>
</mx:FormItem>
<mx:FormItem label="Medidas:">
<comboComponents:ComboMedidas id="list_medidas_edit"/>
</mx:FormItem>
<mx:FormItem label="Clases:">
<comboComponents:ComboClases id="list_clases_edit" />
</mx:FormItem>
<mx:FormItem label="Descripcion">
<mx:TextArea id="text_descipcion_edit" width="160" height="100"/>
</mx:FormItem>
<mx:FormItem >
<mx:Button id="btn_edit" label="Editar" click="editProducto();" enabled="false"/>
</mx:FormItem>
</mx:Form>
</mx:VBox>
<mx:Form>
<mx:FormHeading label="Buscar Producto"/>
<mx:HBox>
<mx:FormItem label="Buscar:">
//LLAMADO AL COMPONENTE COMBOBOX
<comboComponents:ComboProductos id="list_productos_edit" />
</mx:FormItem>
<mx:FormItem>
//boton para recarar el combobox que cree
<mx:Button id="btn_buscar_edit" label="Buscar" click="recargarCombo()"/>
</mx:FormItem>
</mx:HBox>
</mx:Form>
</mx:Panel>
</mx:TabNavigator>
</mx:Canvas>Y este es el Application que esta en:
src
Código :
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns:comp="components.*" backgroundColor="#FFFFFF">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.remoting.mxml.RemoteObject;
import util.MyRemoteObject;
private function init():void
{
var ro:RemoteObject = new RemoteObject("GenericDestination");
ro.source = "prueba.clases.UsuarioService";
ro.addEventListener(FaultEvent.FAULT, onFault);
ro.addEventListener(ResultEvent.RESULT, onResult);
}
private function onFault(e:FaultEvent):void
{
Alert.show(e.fault.toString(),"Error");
}
private function onResult(e:ResultEvent):void
{
Alert.show(e.result.toString(),"Exito");
}
]]>
</mx:Script>
<mx:Panel title="Panel Administrativo SistemaRossi" width="100%" height="100%" top="10" left="150" right="150" bottom="10">
<mx:TabNavigator width="100%" height="100%" top="10" left="10" right="10" bottom="10">
<comp:Producto width="100%" height="100%"/>
<comp:Proveedor width="100%" height="100%"/>
</mx:TabNavigator>
</mx:Panel>
</mx:Application>[size=]
Y por ultimo esta el error que me sale cuando le doy click en el boton buscar que llama al metodo reloadCombo();
faultCode:Channel.Call.Failed faultString:'error' faultDetail:'NetConnection.Call.Failed: HTTP: Failed'espero que se entienda y me pueda ayudar!!