Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 962085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:26:57+00:00 2026-05-16T01:26:57+00:00

i done as follows i have a method with brings data of particular table,

  • 0

i done as follows

i have a method with brings data of particular table, as given my parameter to that method,

now i want to fetch data from corresponding table and it too list, and send back flex and form dynamically Grid & add dataprovider dynamically as for its corresponded table colomns in flex side ?

Remote objec(java class)

 public List<List<String>> getMasterTableData(String name) 
 { 
  String designMaster = "tbl_design_master"+name;

  String masterTableName = "tbl_master"+name; 

  String[][] res ;

  List<List<String>> list = new ArrayList<List<String>>();

  try 
  {
   st = connection.createStatement();

   ResultSet rs1 = st.executeQuery("select * from "+designMaster);

   int len = 0;

   while(rs1.next())
   { len++; }

   ResultSet rs2 = st.executeQuery("select * from "+masterTableName);

   while(rs2.next())
   { 
    List<String>  ll = new ArrayList<String>();

    for(int i=1;i<=len; i++)
    {
     ll.add(rs2.getString(i));     
    }    
    list.add(ll);
   }   
  }
  catch (SQLException e) {   
   e.printStackTrace();
  }

  return list;
 }

flex code :

<mx:RemoteObject id="RO" destination="adminServiceImpl"> 
 <mx:method name="getMasterDesign" result="getMasterDesignRH(event)" fault="FH(event)" />
 <mx:method name="getMasterTableData" result="getMasterTableDataRH(event)" fault="FH(event)"/>
</mx:RemoteObject> 

 <mx:Script>
  <![CDATA[

  [Bindable] private var ac:ArrayCollection = new ArrayCollection(); 

  public function init(Str:String):void
  {
   RO.getMasterDesign(Str);

   Application.application.selectedgridItem = Str;

   RO.getMasterTableData(Str);
  }

  private function getMasterDesignRH(event:ResultEvent):void
  {
   Application.application.designList = event .result as ArrayCollection; 

   var aColumns:Array = new Array();   

   for(var i:int=0; i< Application.application.designList.length; i++)
   { 
    var dgc:DataGridColumn = new DataGridColumn();

    dgc.headerText = Application.application.designList.getItemAt(i).colName; 

    //dgc.dataField = Application.application.designList.getItemAt(i).colName;

    aColumns.push(dgc);   
   }
   mainGrid.columns = aColumns;
  }
  private function getMasterTableDataRH(event:ResultEvent):void
  {
   ac = event.result as ArrayCollection; 

   mainGrid.dataProvider  = ac;  
  }  
  private function FH(event:FaultEvent):void{ 
   Alert.show(event.fault.faultString);  
  }


  ]]>
 </mx:Script>

  <mx:HBox width="100%" height="80%">
   <mx:DataGrid id="mainGrid" width="100%" height="100%" />
  </mx:HBox>

getMasterDesign is an ArrayCollection, which is filled with the column names and components to be displayed

Ex : getMasterDesign(emp)
empMasterDesign table looks like as follows

colName    component 
--------------------
EmpName    textBox
empSal     textBox 
empDesi    ComboBox 

empMasterData:

empName | EmpSal | EmpDesi 
abc       1000     Cler## Heading ##ck 
xyz       2000     Manager

Now i want this create a Datagrid in flex dynamically by using its design & master data table in action script i done everyting , my dataGrid had formed as for his master design,but data is not showing ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T01:26:58+00:00Added an answer on May 16, 2026 at 1:26 am

    You must set the dataField to the appropriate value. From the given data, it looks like colName field in the metadata and its corresponding name in the table are not the same. For example it is EmpName in the design and empName in the original table; none of the fields match – empSal vs EmpSal, empDesi vs EmpDesi. Fix that, assign colName to the dataField, and you should be good to go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a process as follows: User does a complex search that is done
I have a receive callback from an async client method that is supposed to
I have a csv file arranged as follows: Person,Date1,Date2,Status Person1,12/10/11,17/10/11,Done ... I want to
I have a pre-save method defined when saving a document, as follows: Org.pre(save,function(next, done)
I have a program that progresses as follows. I call a method called getCharacteristics
Have done some research and found some stuff that may be helpful. I would
I am done with the project which connects to database (MySQL). Now I want
I have a dropdown list that I want to show only certain options when
I am new to WCF. I have done an application which is as follows
I have a C# .dll that is envoked from within a C# application useing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.