For better understanding I am sending you the files:

----------------------------------------------------------------
package transparency;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;
import java.util.ArrayList;
import transparency.CompanyRicVo;

import com.msdw.transparency.util.Factory;
import com.msdw.transparency.manager.ITransparency;

public class CompanyRic
{
      private static List ricList;
      static String query = "select  distinct x2.ticker ric, c.description"+
                        " from    ge_company c," +
                        " ge_security s," +
                        " ge_xref_sec_code x1," +
                        " ge_xref_sec_code x2," +
                        " ge_xref_sec_code x3" +
                        " where   c.company_id=s.company_id" +
                        " and     s.sec_index_deriv_id=x1.sec_index_deriv_id" +
                        " and     x2.sec_index_deriv_id=x1.sec_index_deriv_id" +
                        " and     x3.sec_index_deriv_id=x1.sec_index_deriv_id" +
                        " and     x1.tick_type=9" +
                        " and     x2.tick_type=1" +
                        " and     x3.tick_type=13" +
                        " and     s.deriv_type_id=3" +
                        " order by x2.ticker";


      public CompanyRic(){}     
      static{
            //System.out.println(query);
                  ricList = new ArrayList();
                  try{
                        ITransparency trans = Factory.getInstance().getTransparency();
                        Connection con = trans.getConnection("");
                        //System.out.println("Got the connection");
                        PreparedStatement ps = con.prepareStatement(query);

                        ResultSet rs = ps.executeQuery();
                        //System.out.println()
                        while(rs.next())
                        {
                              int i=1;
                              ricList.add(new CompanyRicVo(rs.getString(i++),rs.getString(i++)));
                        }
//                        System.out.println(ricList.size());
                 
                  }catch(Exception e)
                  {
                        e.printStackTrace();
                  }
            }

      public List  getRics()
      {
            return ricList;
      }

      public static void main(String args [])
      {
            CompanyRic ric = new CompanyRic();
//            List rList = ric.getRics();
//            System.out.println(rList.size());
      }

}



--------------------------------------------------------------
package transparency;

public class CompanyRicVo
{
      private String ric;
      private String companyDesc;

      public CompanyRicVo(String ric, String companyDesc)
      {
            this.ric = ric;
            this.companyDesc = companyDesc;
      }
     
      public void setRic(String ric)
      {
            this.ric = ric;
      }
      public String getRic()
      {
            return ric;
      }
      public void setCompanyDesc(String companyDesc)
      {
            this.companyDesc = companyDesc;
      }
      public String getCompanyDesc()
      {
            return companyDesc;
      }



}

------------------------------------------------------------------
Now if you see all I want to do is display the label as the
companyDesc and data as ric.


Thanks
S






-------------------------------------------------------------------



--- In flexcoders@yahoogroups.com, Sandip Patil <[EMAIL PROTECTED]>
wrote:
>
> Hi,
>   
>   try this
>   
>   
>      <mx:Script>
>           var data= [ {label:"A", data:A}, {label:"B", data:B}];
>           var selectedItem:Object;
>       </mx:Script>
>   
>   
>       <mx:HBox >
>           <mx:ComboBox dataProvider="{data}"
change="selectedItem=event.target.selectedItem"/>
>           <mx:VBox >
>             <mx:Label text="{selectedItem.label}"/>
>             <mx:Label text="{selectedItem.data}"/>
>         </mx:VBox>
>       </mx:HBox>
>  
> sarvesh610 <[EMAIL PROTECTED]> wrote:
>   Hi,
> I am new to Flex, have been a J2EE person for a longtime. I have
> developed an application which queries the database and returns me a
> value object which has a list and vector. Now I need to use Flex as a
> user interface. I have called the class using the remote-object, but
> then how do I use the List and the Vector to display.
> Also I am a bit confused about the <mx:ComboBox>, how can I use the
> dataprovider to use my value object to display the companyDesc as the
> label and data as the ric if I am using the <mx:Object>
>
> Thanks
> S
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
>
>
>
>   SPONSORED LINKS
>         Web site design development   Computer software development
  Software design and development     Macromedia flex   Software
development best practice
>    
> ---------------------------------
>   YAHOO! GROUPS LINKS
>
>    
>     Visit your group "flexcoders" on the web.
>    
>     To unsubscribe from this group, send an email to:
>  [EMAIL PROTECTED]
>    
>     Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
>
>    
> ---------------------------------
>  
>
>
>
>                  
> ---------------------------------
> Sneak preview the  all-new Yahoo.com. It's not radically different.
Just radically better.
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to