9 Replies Latest reply on May 19, 2010 10:33 PM by athiroy

    flex data Access

    athiroy Level 1

      hi

      i am working in flex and java.

      i have used blazeds in my flex project

      i have retrieve the data from mysql in flex project.

      i have retrieve the records using flex datagrid.

      but i want retrive the records using textinput.

      how can i do??

      any body help  me

      regards

      athi

        • 1. Re: flex data Access
          BhaskerChari Level 4

          Hi athi,

           

          I dint get your idea behind the below two lines you mentioned...

           

          i have retrieve the records using flex datagrid.

          but i want retrive the records using textinput.

           

          Can you please elaborate..?

           

          Thanks,

          Bhasker Chari

          • 2. Re: flex data Access
            athiroy Level 1

            hi

             

            i have the following textinput in flex project

             

            zipcodetxt,areatxt,citytxt,statetxt,countrytxt.

            when i enter the zipcode value in textinput then the database retrieve the records of

            area,city,country and state  values from zipcode table( database: mysql).

             

            the database retrieve --i used java coding.

             

            if view the database records in my flex project i have use flex datagrid.

            but the requirement is using textinput  view  the database records.

             

             

            example

            private function getPincodeResultHandler(event:ResultEvent):void

            {                                                     
                            
                            adg1.dataProvider=event.result;                           
                             adg1.visible=true;         
                      
            }

            adg1-- is the advanced datagrid id.

            it displays the area,city,state,country.

            i don't want to use datagrid.

            one more hint: zipcode retrieve from database one record only at a time.

            example

            zipcode: 600001

            city: chennai          state:TamilNadu         Country: India

             

             

             

             

            but i want  the area,city,state,country values are displays in textinput named areatxt,statetxt,countrytxt,citytxt.

            how it possible.

             

            how can i do??

             

             

            regards

            athi

            • 3. Re: flex data Access
              SunilAdobe Adobe Employee

              Try using Generate Form option under Data menu.

               

              -Sunil

              • 4. Re: flex data Access
                athiroy Level 1

                hi

                 

                could explain brief

                because i am new in flex

                could u give simple example

                regards

                athi

                • 6. Re: flex data Access
                  BhaskerChari Level 4

                  Hi,

                   

                  Write a keyUp event for the zipcodetxt and call the server side method or httpService which ever you are using for dataaccess in your application.

                   

                  After the resultHandler "getPincodeResultHandler" is called then assign the textInput text property based on the event object.

                   

                  private function getPincodeResultHandler(event:ResultEvent):void

                  {              

                                 areatxt.text = event.result.yourobject.area;

                                 citytxt.text = event.result.yourobject.city;

                                 statetxt.text = event.result.yourobject.state;

                                 countrytxt.text = event.result.yourobject.country;
                  }

                   

                  In your mysql database use the query "Select area,city,state,country from zipcodetable where zipcode = " . $passedzipcode

                   

                  I hope the zipcode table has got all the information above.

                   

                  If this post answers your question or helps, please mark it as such.

                   

                  Thanks,

                  Bhasker Chari

                  1 person found this helpful
                  • 7. Re: flex data Access
                    athiroy Level 1

                    hi

                    thank u for ur reply.

                    areatxt.text = event.result.yourobject.area;

                     

                    here yourobject means what

                     

                    regards

                    athi

                    • 8. Re: flex data Access
                      BhaskerChari Level 4

                      "yourobject" may be anything based on the query or depends on the java data access method..

                       

                      Put a breakpoint in the getZipCode resultHandler function and debug the app...you come to know what should be used in place of yourobject...accordingly you adjust the code...

                       

                      If this post answers your question or helps, please mark it as such.

                       

                      Thanks,

                      Bhasker Chari

                      • 9. Re: flex data Access
                        athiroy Level 1

                        hi

                        thanks a lot

                         

                        regards

                        athi