Boa Tarde Galera, espero que alguem possa dar uma força. Estou montando um projeto com Flex4 e Zend PHP, segui todos os passos e adicionei o zend no projeto. Gerei um data form e ajustei como devido, ao executar o projeto nenhum erro, abro meu componente com o form e ele faz o cadastro certinho, MAS quando tento preencher o form novamente e grava no banco ele não grava no banco e não da menssagem de erro nenhuma? Tentei debugar mas não achei o erro. Será que alguem pode dar uma força? Segue codigo do main e do componente:
MAIN - MAIN - MAIN <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" currentState="Login" pageTitle="DDCA - Sistema de Controle Interno"> <!-- States --> <s:states> <s:State name="Login"/> <s:State name="Principal"/> </s:states> <s:controlBarLayout> <s:HorizontalLayout horizontalAlign="right" gap="2" paddingRight="3" paddingTop="3" verticalAlign="middle"/> </s:controlBarLayout> <s:controlBarContent.Principal> <mx:Image autoLoad="true" scaleContent="false" source="assets/ max.png" id="figFullscreen" width="12" height="12" click="btn_fullscreen(event);"/> <mx:Image autoLoad="true" scaleContent="false" source="assets/ close.png" id="figFechar0" width="12" height="12" click="{this.currentState='Login'};"/> </s:controlBarContent.Principal> <!-- Transição de elementos --> <s:transitions> <s:Transition> <s:Parallel> <s:Rotate3D id="rotateEffect" angleXFrom="0" angleXTo="180" angleYFrom="0" angleYTo="180" duration="1000" autoCenterTransform="true" effectStart="btnLogar.enabled=false" effectEnd="btnLogar.enabled=true" target="{pnlLogin}" /> <s:Fade target="{pnlLogin}" duration="1000" /> </s:Parallel> </s:Transition> </s:transitions> <fx:Script> <![CDATA[ import componentes.winCadFunc; import flash.events.*; import mx.controls.Alert; import mx.controls.Image; import mx.core.IFlexDisplayObject; import mx.core.mx_internal; import mx.events.CloseEvent; import mx.events.MenuEvent; import mx.managers.PopUpManager; import spark.components.Button; import spark.components.TitleWindow; include "IncludeIcones.as"; //Função responsavel por criar a janela private function showWin(winComp:Class):void { var Janela:TitleWindow = PopUpManager.createPopUp(this, winComp, true) as TitleWindow; PopUpManager.centerPopUp(Janela); Janela.addEventListener("close", closeHandler); } //Função responsavel por fechar a janela private function closeHandler(event:Event):void { event.target.removeEventListener("close", closeHandler); PopUpManager.removePopUp(event.target as IFlexDisplayObject); } //Função responsavel por ativar a ação do menu private function handleItemClick(event:MenuEvent):void { var data:String = event.item.@data; switch (data){ case "Func_cad": showWin(winCadFunc); //Alert.show(data); break; } } //Função responsavel por deixar a tela fullscreen [Bindable] private var fullScreenState:String; private function init():void { fullScreenState = stage.displayState; } private function btn_fullscreen(evt:MouseEvent):void { if (figFullscreen.focusEnabled) { fullScreenState = StageDisplayState.FULL_SCREEN; } else { fullScreenState = StageDisplayState.NORMAL; } try { stage.displayState = fullScreenState; } catch (any:*) { // ignore } } ]]> </fx:Script> <!-- Declarações --> <fx:Declarations> <!-- Menu --> <fx:XMLList id="menuXML"> <fx:menuitem label="Usuário" data="Usuario" icon="iconeFunc"> <fx:menuitem label="Cadastrar" data="Func_cad" icon="iconeAdd"/> <fx:menuitem label="Alterar" data="Func_alt" icon="iconeEdit"/> <fx:menuitem label="Excluir" data="Func_exc" icon="iconeRemover"/> </fx:menuitem> <fx:menuitem label="Animal" data="Animal" icon="iconeDog"> <fx:menuitem label="Cadastrar" data="Ani_cad" icon="iconeAdd"/> <fx:menuitem label="Alterar" data="Ani_alt" icon="iconeEdit"/> <fx:menuitem label="Excluir" data="Ani_exc" icon="iconeRemover"/> </fx:menuitem> <fx:menuitem label="Doação" data="Doacao" icon="iconeAdocao"> <fx:menuitem label="Cadastrar" data="Doa_cad" icon="iconeAdd"/> <fx:menuitem label="Alterar" data="Doa_alt" icon="iconeEdit"/> <fx:menuitem label="Excluir" data="Doa_exc" icon="iconeRemover"/> </fx:menuitem> <fx:menuitem label="Obito" data="Obito" icon="iconeObito"> <fx:menuitem label="Cadastrar" data="Obi_cad" icon="iconeAdd"/> <fx:menuitem label="Alterar" data="Obi_alt" icon="iconeEdit"/> <fx:menuitem label="Excluir" data="Obi_exc" icon="iconeRemover"/> </fx:menuitem> <fx:menuitem label="Solicitacao" data="Solicitacao" icon="iconeSolicitacao"> <fx:menuitem label="Cadastrar" data="Sol_cad" icon="iconeAdd"/> <fx:menuitem label="Alterar" data="Sol_alt" icon="iconeEdit"/> <fx:menuitem label="Excluir" data="Sol_exc" icon="iconeRemover"/> </fx:menuitem> <fx:menuitem label="Relatorios" icon="iconeRelatorio"> <fx:menuitem label="Animais" data="Rel_animais" icon="iconeRel"/> <fx:menuitem label="Obitos" data="Rel_obitos" icon="iconeRel"/> <fx:menuitem label="Solicitações" data="Rel_solicitacao" icon="iconeRel"/> </fx:menuitem> </fx:XMLList> </fx:Declarations> <!-- Inserindo elementos na pagina principal --> <mx:Image includeIn="Principal" height="16" id="figLogo" scaleContent="false" autoLoad="true" top="5" left="5" width="32"/> <mx:MenuBar includeIn="Principal" itemClick="handleItemClick(event)" dataProvider="{menuXML}" iconField="@icon" labelField="@label" showRoot="true" cornerRadius="12" id="menu" selectionColor="#B2F400" rollOverColor="#CFFF4F" textAlign="left" includeInLayout="true" top="5" right="99" left="99" chromeColor="#BAFF00" symbolColor="#ACEC00"/> <!-- Painel de login --> <s:Panel includeIn="Login" width="250" height="177" id="pnlLogin" title="Login" textAlign="center" fontFamily="Arial" fontWeight="bold" fontSize="20" color="#FFFFFF" borderVisible="true" dropShadowVisible="true" cornerRadius="5" focusColor="#AEFF00" chromeColor="#84FF00" horizontalCenter="0" verticalCenter="0" rollOverColor="#C3FFA2"> <s:TextInput x="76.85" y="70.45" width="161" textAlign="left" maxChars="11" displayAsPassword="true" color="#000000"/> <s:Label x="10" y="78" text="Senha" color="#000000"/> <s:TextInput x="76.75" y="16.95" width="161" textAlign="left" color="#000000"/> <s:Button label="Entrar" id="btnLogar" fontFamily="Arial" fontSize="15" color="#000000" lineThrough="false" y="111" horizontalCenter="0" click="{this.currentState='Principal'}"/> <s:Label x="10" y="24" text="Login" color="#000000"/> </s:Panel> </s:Application> COMPONENTE - COMPONENTE COMPONENTE <?xml version="1.0" encoding="utf-8"?> <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="800" height="500" buttonMode="true" cornerRadius="5" backgroundAlpha="0.8" chromeColor="#84FF00" xmlns:usuarioservice="services.usuarioservice.*" fontSize="16" xmlns:valueObjects="valueObjects.*" symbolColor="#000000" title="Cadastro de Usuário"> <fx:Script> <![CDATA[ import mx.controls.Alert; import mx.events.FlexEvent; import mx.binding.utils.*; protected function txt_telefone_focusOutHandler(event:FocusEvent):void { telefone_hTextInput.text = formatadorCampoDeTelefone.format(telefone_hTextInput.text); } //Envio protected function dataGrid_creationCompleteHandler(event:FlexEvent):void { getAllUsuarioResult.token = usuarioService.getAllUsuario(); } protected function button_clickHandler(event:MouseEvent):void { var usuario2:Usuario = new Usuario(); //usuario2.id_func = parseInt("null"); usuario2.nome = nomeTextInput.text; usuario2.sobrenome = sobrenomeTextInput.text; usuario2.telefone_h = telefone_hTextInput.text; usuario2.telefone_c = telefone_cTextInput.text; usuario2.email = emailTextInput.text; usuario2.login = loginTextInput.text; usuario2.senha = senhaTextInput.text; usuario2.data_n = data_nDateField.selectedDate; if(ddlCadFunc.selectedIndices.toString() == "0"){ usuario2.nivel = parseInt("1"); //Alert.show("Adm"); } if(ddlCadFunc.selectedIndices.toString() == "1"){ usuario2.nivel = parseInt("2"); //Alert.show("Usuario"); } usuario2.status = parseInt("1"); createUsuarioResult.token = usuarioService.createUsuario(usuario2); //Alert.show("Nome: "+usuario2.nome.toString()+"\nSobrenome: "+usuario2.sobrenome.toString()+"\nLogin: "+usuario2.login.toString()); nomeTextInput.text = ""; sobrenomeTextInput.text = ""; telefone_hTextInput.text = ""; telefone_cTextInput.text = ""; emailTextInput.text = ""; loginTextInput.text = ""; senhaTextInput.text = ""; data_nDateField.selectedDate = null; } ]]> </fx:Script> <fx:Declarations> <s:CallResponder id="getAllUsuarioResult"/> <usuarioservice:UsuarioService id="usuarioService" fault="Alert.show('Usuário Cadastrado com sucesso!')" showBusyCursor="true"/> <valueObjects:Usuario id="usuario"/> <s:CallResponder id="createUsuarioResult"/> <!-- Validações --> <mx:PhoneNumberValidator id="pnVHome" requiredFieldError="Este campo é obrigatorio." source="{telefone_hTextInput}" property="text" wrongLengthError="Formato incorreto. ex: DDXXXXXXXX" minDigits="10" /> <mx:PhoneFormatter id="formatadorCampoDeTelefone" formatString="(##) ####-####"/> </fx:Declarations> <s:Panel height="200" cornerRadius="3" left="5" right="5" bottom="5" title="USUÁRIOS CADASTRADOS" textAlign="center" fontWeight="bold" id="pnlCadFunc" fontSize="12"> <mx:DataGrid id="dgrCadFunc" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getAllUsuarioResult.lastResult}" editable="false" verticalAlign="middle" textAlign="center" fontSize="10" fontWeight="bold" variableRowHeight="true" right="5" left="5" bottom="5" horizontalCenter="0" top="5"> <mx:columns> <mx:DataGridColumn headerText="Nome" dataField="nome" wordWrap="false"/> <mx:DataGridColumn headerText="Sobrenome" dataField="sobrenome" sortable="false"/> <mx:DataGridColumn headerText="Telefone" dataField="telefone_h" width="100" sortable="false"/> <mx:DataGridColumn headerText="Celular" dataField="telefone_c" width="100" sortable="false"/> <mx:DataGridColumn headerText="Email" dataField="email"/> <mx:DataGridColumn headerText="Login" dataField="login" width="100"/> <mx:DataGridColumn headerText="Data Nascimento" dataField="data_n" resizable="true" sortable="false" /> </mx:columns> </mx:DataGrid> </s:Panel> <!-- <mx:Form defaultButton="{button}" height="232" horizontalGap="10" horizontalCenter="2" left="126" right="120" y="11"> --> <!-- <mx:FormItem direction="horizontal"> --> <!-- <mx:FormItem direction="vertical"> --> <mx:FormItem label="Celular" x="10" y="96" horizontalAlign="left" fontWeight="bold" dropShadowVisible="true" cornerRadius="5"> <s:TextInput id="telefone_cTextInput" text="{usuario.telefone_c}" width="274" fontWeight="normal" toolTip="ex: (XX) XXXX-XXXX"/> </mx:FormItem> <mx:FormItem label="Nome" required="false" x="10" y="6" dropShadowVisible="true" cornerRadius="5" fontWeight="bold"> <s:TextInput id="nomeTextInput" text="{usuario.nome}" width="282" fontWeight="normal"/> </mx:FormItem> <mx:FormItem label="Sobrenome" x="10" y="36" fontWeight="bold" width="346" dropShadowVisible="true" cornerRadius="5"> <s:TextInput id="sobrenomeTextInput" text="{usuario.sobrenome}" width="238" fontWeight="normal"/> </mx:FormItem> <mx:FormItem label="Telefone Residencial" x="10" y="66" fontWeight="bold" width="346" dropShadowVisible="true" cornerRadius="5"> <s:TextInput id="telefone_hTextInput" text="{usuario.telefone_h}" toolTip="ex: (XX) XXXX-XXXX" focusOut="txt_telefone_focusOutHandler(event)" focusIn="txt_telefone_focusOutHandler(event)" fontWeight="normal" width="167"/> </mx:FormItem> <mx:FormItem label="Email" x="10" y="156" fontWeight="bold" dropShadowVisible="true" cornerRadius="5" width="347" required="false" textAlign="left"> <s:TextInput id="emailTextInput" text="{usuario.email}" width="285" fontWeight="normal"/> </mx:FormItem> <!-- </mx:FormItem> --> <!-- <mx:FormItem direction="vertical"> --> <mx:FormItem label="Login" x="484" y="66" required="false" fontWeight="bold" width="236"> <s:TextInput id="loginTextInput" text="{usuario.login}" width="172" fontWeight="normal"/> </mx:FormItem> <mx:FormItem label="Senha" x="484" y="96" required="false" fontWeight="bold"> <s:TextInput id="senhaTextInput" text="{usuario.senha}" fontWeight="normal" width="167"/> </mx:FormItem> <mx:FormItem label="Data de Nascimento" x="10" y="126" fontWeight="bold" dropShadowVisible="true" cornerRadius="5"> <mx:DateField id="data_nDateField" selectedDate="{usuario.data_n}" width="175" fontWeight="normal" dayNames="['D', 'S', 'T', 'Q', 'Q', 'S', 'S']" monthNames="['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio','Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro','Dezembro']" showToday="false" formatString="DD/MM/YYYY" editable="false"/> </mx:FormItem> <s:Button label="Cadastrar" id="button" click="button_clickHandler(event)" y="233" horizontalCenter="0"/> <s:DropDownList x="324" y="204" id="ddlCadFunc" width="143" textAlign="center"> <mx:ArrayCollection> <fx:String>Administrador</fx:String> <fx:String>Usuário</fx:String> </mx:ArrayCollection> </s:DropDownList> <!-- </mx:FormItem> --> <!-- </mx:FormItem> --> <!-- </mx:Form> --> </s:TitleWindow> -- Você recebeu esta mensagem porque está inscrito na lista "flexdev" Para enviar uma mensagem, envie um e-mail para flexdev@googlegroups.com Para sair da lista, envie um email em branco para flexdev-unsubscr...@googlegroups.com Mais opções estão disponíveis em http://groups.google.com/group/flexdev