On 11/30/16, 9:25 PM, "sankar" <santanu4...@gmail.com> wrote:
>Alex Harui wrote >> You should be able to convert ProductItemRenderer to MXML and use >> data-binding, or just have the AS version listen for the appropriate >>event >> fired from the data item. > >I've tried to create a new MXML component based on DataItemRenderer, but I >couldn't even build compiler starts showing this error: > >/1551: Internal error in ABC generator subsystem, when generating code >for: >E:\apache-flex-flexjs-0.8.0-bin\examples\flexjs\DataGridExample\src\produc >ts\ProductItemRendererMXML.mxml: >java.lang.NullPointerException >/ >Is that class supposed to be extended as MXML component? If you get an internal error, that's probably a bug in the compiler. File a JIRA issue with the renderer. There is probably some pattern you are using that is fooling the compiler. > > >Alex Harui wrote >> Because of the pay-as-you-go philosophy, the data >> provider used in the example does not dispatch collection change events, >> and the DataGrid and renderers aren't listening for it. > >What alteration do I need to make the example works to dispatch collection >change event and DataGrid/renderers listens to it? > It looks like DataGridExample is already using ArrayList. But I think there isn't any code that will send itemUpdated if a field in an item changes, only if an item changes. If you can get itemUpdated to dispatch you can then see if any code is listening and will do the right thing, but it might be less work to have a custom renderer with binding like you tried above. HTH, -Alex