0 Replies Latest reply on Aug 30, 2007 7:57 PM by b_d_hoover

    Custom ItemRenderer tag which requires other data

    b_d_hoover
      I'm trying to design a custom itemrenderer, which converts IDs from one web service into data from another web services. But I need to be able to only generate the itemrenderer once the supporting web service has been completed. I can't figure out how to reinvoke the itemrender when the web service has completed.

      For example, I might have one webservice that has
      UserName, StateCode

      and another web service that has
      StateCode, Senators

      In the final display, I would like to show
      Username in one column
      A list of Senators in the state in the next column.

      Obviously, this won't make sense until BOTH webservices are completed.

      So... I'm trying something like:
      <mx:DataGrid dataProvider="{USERS}">
      <mx:columns>
      <mx:DataGridColumn dataField="USERNAME"/>
      <mx:DataGridColumn dataField="STATECODE"
      itemRenderer="customTag"/>
      </mx:columns>
      </mx:DataGrid>

      The customTag then has an label field which is populated by via some ActionScript.

      The problem is that the itemRenderer is sometimes being invoked before the senators web service is completed. Both the user webservice and the senators webservices were invoked at the same time, but obviously one can complete after the other, at random. This then leaves the senator list blank, until the item renderer is reinvoked.

      So... how do I create the custom itemRenderer to know that it should either only invoke once the sentator's webservice is complete, or that it should refresh when the senator's webservice is complete?

      Thanks in advance for any help that you might be able to give.

      Brian