Rapaz...é grande...hehehe

abaixo:


<?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" 
creationComplete="{init()}"
                           xmlns:mx="library://ns.adobe.com/flex/mx" 
height="800"
width="940" currentState="DadosPrincipais">
        <fx:Style>
                @namespace s "library://ns.adobe.com/flex/spark";
                @namespace mx "library://ns.adobe.com/flex/mx";

        
                global
                {
                        vertical-align: top;
                }
        </fx:Style>
        <s:states>
                <s:State name="Musica"/>
                <s:State name="Release"/>
                <s:State name="Fotos"/>
                <s:State name="Videos"/>
                <s:State name="Contato"/>
                <s:State name="DadosPrincipais"/>
        </s:states>
        <fx:Declarations>
                <!-- Place non-visual elements (e.g., services, value objects) 
here -->
                
                <s:RemoteObject id="ro" destination="zend" source="BandaService"
showBusyCursor="true"
                                                fault="ro_faultHandler(event)">
                        <s:method name="getObjeto" 
result="{retornoGetObjeto(event)}"/>
                        <s:method name="salvarContato" 
result="{retornoSalvarContato(event)}"/>
                </s:RemoteObject>       
                
                <s:RemoteObject id="roEstilo" destination="zend"
source="EstiloService" showBusyCursor="true"
                                                fault="ro_faultHandler(event)">
                        <s:method name="getLista" 
result="{retornoGetListaEstilo(event)}"/>
                </s:RemoteObject>       
                
        </fx:Declarations>
        <s:BorderContainer x="9" y="5" width="598" height="112"
backgroundColor="#F0EEEE" id="grpInformacao">
                <mx:Image x="10" y="10" width="132" height="91"/>
                <s:Label x="150" y="25" text="NOME DA BANDA" fontWeight="bold"
fontFamily="Verdana" fontSize="24"/>
                <s:Label x="152" y="58" text="ESTILO"/>
                <s:Label x="313" y="58" text="CIDADE"/>
                <s:Label x="475" y="58" text="VISITAS"/>
        </s:BorderContainer>

        <s:Group includeIn="Musica" x="218" y="166" width="700" height="624">
                <s:RichText x="10" y="113" text="As MP3 que você enviar por este
formulário serão publicadas no site.&#xd;&#xd;Dicas:&#xd;1. Não serão
aceitos covers ou versões&#xd;2. Bitrate de 64 até 128 KHz&#xd;3. Taza
de amostragem 44.1 KHz&#xd;4. Tamanho máximo do arquivo: 10MB;"
width="423" height="121"/>
                <s:TextInput x="10" y="233" width="378" id="edtMusica"/>
                <s:Button x="394" y="233" label="Selecionar arquivo"
id="btnSelecionarArquivoMusica"/>
                <s:Button x="394" y="262" label="Enviar" width="123" 
id="btnEnviarArquivo"/>
                <s:Label x="90" y="36" text="MÚSICA" fontWeight="bold" 
fontSize="19"/>
                <mx:Image x="18" y="10" source="img/icon_headfone.png"/>
                <mx:DataGrid x="10" y="278" height="336" width="376" 
id="grdMusica">
                        <mx:columns>
                                <mx:DataGridColumn headerText="Column 1" 
dataField="col1" visible="false"/>
                                <mx:DataGridColumn headerText="Música" 
dataField="col2"/>
                        </mx:columns>
                </mx:DataGrid>
        </s:Group>
        <s:Group x="218" y="166" width="700" height="624"
includeIn="Contato,Fotos,Release,Videos">
                <s:RichText x="10" y="113" width="507" height="121"
text.Release="Release é o texto que apresenta o a banda de forma mais
completa.&#xd;Cuidado com tamanho de texto, seja objetivo e cuidado
com a ortografia." text.Fotos="Extensão aceitas: GIF, JPG e
PNG;&#xd;Largura ou alterua máxima da foto: 1280 pixels;&#xd;Tamanho
máximo do arquivo: 1MB;&#xd;Espere a confirmação do envio para ter
certeza que sua foto chegou completa;" includeIn="Fotos,Release"/>
                <s:Label x="90" y="36" fontWeight="bold" fontSize="19"
text.Release="RELEASE&#xd;" text.Fotos="FOTOS" text.Videos="VÍDEOS"
text.Contato="CONTATO"/>
                <mx:Image x="18" y="18" source="img/contato.png" 
includeIn="Contato"/>
                <s:TextArea includeIn="Release" x="10" y="151" width="507"
height="290" id="edtRelease" text="{banda.release}"/>
                <s:TextInput width="378" includeIn="Fotos" x="10" y="193" 
id="edtVideo"/>
                <s:TextInput width="378" includeIn="Fotos" x="10" y="243"
id="edtTituloVideo"/>
                <s:Button label="Selecionar arquivo" includeIn="Fotos" x="394"
y="193" id="btnSelecionarVideo"/>
                <s:Button label="Enviar" width="123" includeIn="Fotos" x="396"
y="243" id="btnEnviarVideo"/>
                <s:Label includeIn="Fotos" text="Legenda" x="10" y="223"/>
                <mx:DataGrid includeIn="Fotos" width="507" x="10" y="272" 
height="172">
                        <mx:columns>
                                <mx:DataGridColumn dataField="col1" 
headerText="codigo" width="0"/>
                                <mx:DataGridColumn dataField="col2" 
headerText="Imagens
Registradas" width="300"/>
                                <mx:DataGridColumn headerText="Column 3" 
dataField="col3"/>
                        </mx:columns>
                </mx:DataGrid>
                <s:Button x="525" y="313" label="Quero ver minhas fotos" 
width="163"
includeIn="Fotos"/>
                <mx:Form x="14" y="79" width="646" height="427" 
includeIn="Contato">
                        <mx:FormItem label="Nome do contato">
                                <s:TextInput width="300" id="edtContato" 
text="{banda.nome}"/>
                        </mx:FormItem>
                        <mx:FormItem label="Telefone">
                                <s:TextInput width="300" id="edtTelefone" 
text="{banda.telefone}"/>
                        </mx:FormItem>
                        <mx:FormItem label="Telefone Secundário">
                                <s:TextInput width="300" 
id="edtTelefoneSecundario"
text="{banda.telefone_secundario}"/>
                        </mx:FormItem>
                        <mx:FormItem label="Email">
                                <s:TextInput width="300" id="edtEmail" 
text="{banda.email_contato}"/>
                        </mx:FormItem>
                        <mx:FormItem label="Endereço">
                                <s:TextInput width="300" id="edtEndereco" 
text="{banda.endereco}"/>
                        </mx:FormItem>
                        <mx:FormItem label="Cidade">
                                <s:TextInput width="300" id="edtCidade" 
text="{banda.cidade}"/>
                        </mx:FormItem>
                        <mx:FormItem label="Estado">
                                <s:TextInput width="300" id="edtEstado" 
text="{banda.estado}"/>
                        </mx:FormItem>
                        <mx:FormItem label="CEP">
                                <s:TextInput width="300" id="edtCep" 
text="{banda.cep}"/>
                        </mx:FormItem>
                        <mx:FormItem label="Informações Adicionais">
                                <s:TextInput width="300" 
id="edtInformacoeAdicionais"
text="{banda.informacao_adicional}"/>
                        </mx:FormItem>
                        <mx:FormItem label="Site Oficial">
                                <s:TextInput width="300" id="edtSiteOficial" 
text="{banda.site_oficial}"/>
                        </mx:FormItem>
                        <mx:FormItem label="Comunidade no Orkut">
                                <s:TextInput width="300" id="edtOrkut" 
text="{banda.orkut}"/>
                        </mx:FormItem>
                        <mx:FormItem label="Blog">
                                <s:TextInput width="300" id="edtBlog" 
text="{banda.blog}"/>
                        </mx:FormItem>
                        <mx:FormItem label="Fotolog">
                                <s:TextInput width="300" id="edtFotoLog" 
text="{banda.fotolog}"/>
                        </mx:FormItem>
                        <mx:FormItem label="Twitter">
                                <s:TextInput width="300" id="edtTwitter" 
text="{banda.twitter}"/>
                        </mx:FormItem>
                </mx:Form>
                <s:Button includeIn="Contato" x="408" y="514" label="Salvar"
id="btnSalvarContato" click="{clicarSalvarContato()}"/>
                <mx:Image includeIn="Fotos" x="10" y="452" width="217" 
height="162"
id="imgFoto"/>
                <s:Button includeIn="Release" x="447" y="449" label="Salvar"
id="btnSalvarRelease"/>
        </s:Group>
        
        <s:Group x="218" y="166" width="700" height="624"
includeIn="DadosPrincipais" id="grpDadosPrincipais">
                <s:Label x="90" y="36" text="DADOS PRINCIPAIS&#xd;"
fontWeight="bold" fontSize="19"/>
                <s:RichText x="11" y="195" text="A imagem de apresentação deve
possuir 156px de largura por 117px de altura, a proporção de uma
fotografia horizontal padrão (formatos JPG ou PNG)" width="507"
height="35"/>
                <s:TextInput x="10" y="233" width="378" 
id="edtImagemApresentacao0"/>
                <s:Button x="394" y="233" label="Selecionar arquivo"
id="btnSelecionarArquivo0"/>
                <s:Button x="394" y="262" label="Enviar" width="123"
id="btnSalvarDadosPrincipais"/>
                <mx:Image x="12" y="279" width="156" height="117"
source="img/sem_foto.png" id="imgAtual0"/>
                <s:Label x="10" y="263" text="Imagem Atual" fontWeight="bold" 
fontSize="14"/>
                <s:Label x="10" y="90" text="Nome da Banda"/>
                <s:TextInput x="8" y="106" width="378" id="edtNomeBanda"
text="{banda.nome_banda}"/>
                <s:Label x="10" y="136" text="Estilo de Música"/>
                <s:DropDownList x="10" y="156" width="376" id="cmbEstilo"
dataProvider="{dpEstilo}" labelField="nome"></s:DropDownList>
        </s:Group>
        <s:Group x="0" y="166" width="219" height="200" id="grpBotoes">
                <s:Button x="9" y="6" label="Dados Principais" width="200"
click="{clicarPrincipal(null)}" id="btnPrincipal0"/>
                <s:Button x="9" y="26" label="Música" width="200"
click="{clicarMusica(null)}" id="btnMusica0"/>
                <s:Button label="Release" width="200" 
click="{clicarRelease(null)}"
id="BtnRelease0" x="9" y="46"/>
                <s:Button label="Fotos" width="200" click="{clicarFotos(null)}"
id="btnFotos0" x="9" y="66"/>
                <s:Button label="Vídeos" width="200" 
click="{clicarVideos(null)}"
id="btnVideos0" x="9" y="86"/>
                <s:Button label="Contato" width="200" 
click="{clicarContato(null)}"
id="btnContato0" x="9" y="106"/>
        </s:Group>
        <fx:Script>
                <![CDATA[
                        import mx.collections.ArrayCollection;
                        import mx.controls.Alert;
                        import mx.core.IFlexDisplayObject;
                        import mx.managers.PopUpManager;
                        import mx.rpc.events.FaultEvent;
                        import mx.rpc.events.ResultEvent;
                        
                        import objeto.BandaVO;
                        
                        [Bindable]
                        public var banda:BandaVO;
                        [Bindable]
                        public var dpEstilo:Array;

                        private function init():void{
                                
                                banda = new BandaVO();
                                dpEstilo=new Array;
                                itemSingleton.getInstance().FormPrincipal=this;
                                abrirLogin();
                                
                        }
                        
                        public function 
retornoGetListaEstilo(e:ResultEvent):void{
                                dpEstilo = e.result.dados;
                                
                        }
                        
                        public function clicarMusica(e:MouseEvent):void{
                                currentState='Musica';
                        }
                        
                        
                        
                        public function 
clicarImagemApresentacao(e:MouseEvent):void{
                                currentState='ImagemApresentacao';
                        }
                        
                        public function clicarRelease(e:MouseEvent):void{
                                currentState='Release';
                        }
                        
                        public function clicarFotos(e:MouseEvent):void{
                                        currentState='Fotos';
                        }
                        
                        public function clicarVideos(e:MouseEvent):void{
                                currentState='Videos';  
                        }
                        
                        public function clicarContato(e:MouseEvent):void{
                                
                                currentState='Contato';                         
                
                        }
                        
                        public function clicarPrincipal(e:MouseEvent):void{
                                
                                currentState='DadosPrincipais';
                        }
                        
                        private function abrirLogin():void{
                                
                                var tela:IFlexDisplayObject = 
PopUpManager.createPopUp(this,login, true);       
                                PopUpManager.centerPopUp(tela);

                        }
                        
                        public  function getObjeto():void{
                                
                                ro.getObjeto.send();
                        }
                        
                        private function retornoGetObjeto(e:ResultEvent):void{
                                
                                banda.blog = e.result.dados[0]['blog'];
                                banda.cep = e.result.dados[0]['cep'];
                                banda.cidade = e.result.dados[0]['cidade'];
                                banda.codigo = e.result.dados[0]['id_banda'];
                                banda.email_cadastro = 
e.result.dados[0]['email_cadastrado'];
                                banda.email_contato = 
e.result.dados[0]['email_contato'];
                                banda.endereco =e.result.dados[0]['endereco'];
                                banda.estado=e.result.dados[0]['estado'];
                                banda.fotolog=e.result.dados[0]['fotolog'];
                                banda.imagem_apresentacao = 
e.result.dados[0]['imagem_apresentacao'];
                                banda.informacao_adicional = 
e.result.dados[0]['informacao_adicional'];
                                banda.legenda = e.result.dados[0]['legenda'];
                                banda.nome = e.result.dados[0]['nome'];
                                banda.nome_banda = 
e.result.dados[0]['nome_banda'];
                                banda.orkut=e.result.dados[0]['orkut'];
                                banda.release = e.result.dados[0]['release'];
                                banda.senha = e.result.dados[0]['senha'];
                                
banda.site_oficial=e.result.dados[0]['site_oficial'];
                                banda.situacao=e.result.dados[0]['situacao'];
                                banda.telefone=e.result.dados[0]['telefone'];
                                
banda.telefone_secundario=e.result.dados[0]['telefone_secundario'];
                                banda.twitter=e.result.dados[0]['twitter'];
                                
                                roEstilo.getLista.send();
                                
                        }
                        
                        public function 
retornoSalvarContato(e:ResultEvent):void{
                                
                                getObjeto();
                                
                        }
                        
                        public function clicarSalvarContato():void{
                                
                                banda.nome = edtContato.text;
                                banda.telefone = edtTelefone.text;
                                banda.telefone_secundario = 
edtTelefoneSecundario.text;
                                banda.email_contato = edtEmail.text;
                                banda.endereco = edtEndereco.text;
                                banda.cidade = edtCidade.text;
                                banda.estado = edtEstado.text;
                                banda.cep = edtCep.text;
                                banda.informacao_adicional = 
edtInformacoeAdicionais.text;
                                banda.site_oficial=edtSiteOficial.text;
                                banda.orkut=edtOrkut.text;
                                banda.blog=edtBlog.text;
                                banda.fotolog=edtFotoLog.text;
                                banda.twitter=edtTwitter.text;
                                
                                ro.salvarContato.send(banda);
                                        
                                        
                                
                        }
                        
                        protected function 
ro_faultHandler(event:FaultEvent):void
                        {
                                // TODO Auto-generated method stub
                                Alert.show(event.message['faultString'],"Erro");
                        }                       
                        
                        
                ]]>
        </fx:Script>
</s:Application>


Em 25 de dezembro de 2010 22:36, principe.boro...@gmail.com
<principe.boro...@gmail.com> escreveu:
> pode mandar o codigo todo?
>
> Em 25 de dezembro de 2010 22:32, Marcelo Florindo
> <marcelo.em.lis...@gmail.com> escreveu:
>>
>> Feliz Natal Galera!,
>>
>>
>>
>> Colegas eu tenho um dropdownlist que é carregado com alguns itens do
>> banco (os itens estão vindo perfeitamentes).
>>
>>
>> componente:
>> <s:DropDownList x="10" y="156" width="376" id="cmbEstilo"
>> dataProvider="{dpEstilo}" labelField="nome">
>>
>> a chamada:
>>
>> roEstilo.getList.send();
>>
>> o retorno:
>>
>> dpEstilo = e.result.dados;
>>
>>
>> O teste:
>> Alert(dpEstilo[0]['nome']);
>>
>> Funciona perfeitamente no teste.
>>
>> Porém o cmbEstilo não preenche...estou trabalhando com states views.
>>
>> Alguém tem alguma idéia do pq não está mostrando no combo???
>>
>> Obrigado a todos,
>>
>>
>> --
>> Marcelo
>>
>> --
>> 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
>
> --
> 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



-- 
Marcelo

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

Responder a