If Abdul's query is true about the data arriving later ... you should maybe call the initCellRenderer later.
I assume you are calling initCellRenderer on initialize of the application. (I assumed so since there are traces of Steven's post (http://www.richinternetapps.com/archives/000072.html) in your post.

Try the following.

1. Call
clTypeSrv.send() in the application tag
2. Call a function
populateComboBox() in the HTTPService tag
3. Populate the values to the ComboBoxRenderer through the script (this ensures that the population happens after data is retrieved)
4. Maybe and a slight maybe that "type" in "clTypeSrv.result.types.type" is a reserved word and is creating a problem! (somebody with better knowledge on this can clarify!)

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" initialize="clTypeSrv.send()">
    <mx:Script>
    <![CDATA[
    function populateComboBox () {
    var comboBoxValues = clTypeSrv.result.types.type;
    ComboBoxCellRenderer.dataProvider = comboBoxValues;
    // You do not have to use the initCellRenderer now ... you are doing it in the above line
    }
    ]]>
    </mx:Script>

    <mx:HTTPService id="clTypeSrv" result="populateComboBox()">
        <mx:request>
        ...........................
        </mx:request>
    </mx:HTTPService>
        ..............
    <mx:DataGrid>
    .......................
    </mx:DataGrid>

</mx:Application>


Regards
Sree

Abdul Qabiz wrote:
When are you calling initCellRenderer? May be data has not yet arrived and
this functiong gets called.

Are you able to see data in initCellRenderer function?


-abdul

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Rajesh Jayabalan
Sent: Tuesday, May 17, 2005 2:12 AM
To: [email protected]
Subject: [flexcoders] cell render problem

Hi,

I am trying to create a combobox cell renderer.

In my mxml file I am trying to set a httpserivce as the dataprovider
for the cell renderer

note:: clTypeSrv is my HTTPService and clTypeSrv.send() is called on
application initilize.

private function initCellRenderer() : Void         
  {
      ComboBoxCellRenderer.dataProvider = clTypeSrv.result.types.type;
  }

this is creating a empty combobox

Note: There is data coming back from the httpserivce as I am using it
in another place

when I set it as static values I can see the combobox.

i.e.,
ComboBoxCellRenderer.dataProvider = [ "Development Director",
"Technical Director", "Technical Architect" ];

How can I make my combobox accept a httpservice as a dataprovider.

Rajesh J






Yahoo! Groups Links








Yahoo! Groups Links

Reply via email to