Question

In the Mate framework for flex. I'm trying to inject a UIComponent into a non UIComponent.

The reason is the UI component is a library component and it has methods that need to be invoked on it. I'm not able to remove the requirement to invoke the methods.

I've got something like this currently

<ObjectBuilder cache="global" generator="{DashboardController}" registerTarget="true"/>
<EventHandlers type="{DashboardEvent.DASHBOARD_CREATION_COMPLETE}">
    <PropertySetter generator="{DashboardController}" 
        targetKey="dashboard"
        source="{lastReturn}"
        sourceKey="target" />
</EventHandlers>

And I'm receiving an error like this.

--------------------------------------------------------- MATE Error: Property type mismatch, turn on the debugger for more information EventType:test.example.events.creationComplete. Error was found in a EventHandlers list in file DashboardEventMap ---------------------------------------------------------

I've also tried using an object builder to set the property.

Was it helpful?

Solution

I suppose the problem is your lastReturn type isn't compatible with DashboardController.dashboard field. Please recheck it.

OTHER TIPS

Got it working. lastReturn was sometimes returning null even though it was in an eventHandling block.

I didn't realise that the event object was in scope here.

<EventHandlers type="{DashboardEvent.DASHBOARD_CREATION_COMPLETE}" debug="true">
    <PropertySetter generator="{DashboardController}" 
            targetKey="dashboard"
            source="{event.target}" />
</EventHandlers>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top