Comunidad de diseño web y desarrollo en internet online

HTTPService problema con envio de variable por POST

Citar            
MensajeEscrito el 26 Ene 2010 04:06 am
Hola, estoy luchando aca con HTTPService que es por defecto el sistema de adobe para comunicarse con algun lenguaje de servidor, en este caso tengo un APACHE + PHP + SQLITE. Igual el servidor no es el problema.

El problema es que envio al archivo PHP y hace todo bien solo que la variable cuando la tomo de la siguiente forma :

Código PHP :

$_POST['buscarTextInput'];


o por GET.. está vacia. lo pude comprobar haciendo un print de un XML en el php de la siguiente forma:

Código PHP :

print "<pacientes><paciente><id>".$_POST['buscarTextInput']."</id><nombre>juan</nombre><documento>53454355</documento><telefono>578738945</telefono></paciente></pacientes>";


esto lo recibo en mxml y lo muestro en un datagrid.. anda todo, solo que la variable esa está vacia.

Mi mxml

Código Flex :

<mx:Canvas label="Buscar" width="100%" height="100%" backgroundColor="#FFFFFF">
         <mx:Label x="10" y="10" text="Paciente : Buscar" fontSize="14" fontWeight="bold"/>
         <mx:Form x="131.5" y="41" width="418" height="63">
            <mx:FormItem>
               <mx:HBox width="100%">
                  <mx:TextInput width="250" id="buscarTextInput"/>
                  <mx:Button label="Button" id="buscarButton" click="send_data()"/>
               </mx:HBox>
            </mx:FormItem>
         </mx:Form>
         
         <mx:DataGrid x="10" y="141" width="661" height="348" dataProvider="{userRequest.lastResult.pacientes.paciente}">
            <mx:columns>
               <mx:DataGridColumn headerText="Nombre" dataField="nombre"/>
               <mx:DataGridColumn headerText="Documento" dataField="documento"/>
               <mx:DataGridColumn headerText="Teléfono" dataField="telefono"/>
               <mx:DataGridColumn headerText="Administrar" dataField="id"/>
            </mx:columns>
         </mx:DataGrid>

      </mx:Canvas>
      <mx:Canvas label="Listado completo" width="100%" height="100%">
      </mx:Canvas>
   </mx:TabNavigator>
    <mx:HTTPService id="userRequest" url="http://localhost:8888/prueba/server-side/request_post2.php" method="POST" useProxy="false" />


Que hay de malo ? :-(

Por sonycrocket

4 de clabLevel



 

firefox
Citar            
MensajeEscrito el 26 Ene 2010 04:33 am
Encontre el error.. no le estaba enviando el valor del textbox

public function send_data():void
{
userRequest.send({buscarTextInput:buscarTextInput.text});
}

Ojala le sirva a alguien almenos ja xD

Por sonycrocket

4 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.