OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – How do I? Questions How to build an asynchronous widget?

This topic contains 2 replies, has 2 voices, and was last updated by  Grégory PLANCHAT 8 years, 7 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #36030

    Grégory PLANCHAT
    Participant

    Hi,

    I’m currently building an inventory bundle and for items stock displays, I cut up the warehouse into zones (in hierarchical tree view).

    The tree building was not a big deal, although interactions with it are for now. I need to update le right hand zone, as seen in this screenshot, when I click on a zone in the tree :

    Screenshot of the tree

    I used a TreeManageComponent, similar to OroB2BCatalogBundle’s one an tried to adapt the onSelect trigger :

    Problem is, mediator.execute(‘widgets:getByAliasAsync’,…) does not trigger the callback.

    I’m not sure if I’m doing the right thing, I’m not already aware of all backbone’s internals and oro widgets.

    Has someone already solved this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #36031

    Hryhorii Hrebiniuk
    Participant

    Hi,

    Yes, you are doing right (on user action getting a widget instance over ‘widgets:getByAliasAsync’ handler). If you handler is not executed, it mean that your widget is not created on this page or it is already disposed.

    Handler ‘widgets:getByAliasAsync’ leads to widgetManager.getWidgetInstanceByAlias method. The widgetManager checks if the widget exists, then immediately executes callback function, otherwise add the callback on widget registration in widgetManager.

    Check your widget’s life cycle, when it is created, when disposed and when you call mediator.execute(‘widgets:getByAliasAsync’, …) handler.

    #36032

    Grégory PLANCHAT
    Participant

    Thanks, for the reply, after some hours searching, I came to the same conclusions and finally took a look in Backbone and Chaplin docs.

    I’m still searching though.

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.

Back to top