문제

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.

도움이 되었습니까?

해결책

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

다른 팁

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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top