Covering OroCRM topics, including community updates and company announcements.  Subscribe

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 2 years, 3 months ago.

  • Creator
  • #30377

    Grégory PLANCHAT


    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
  • #30378

    Hryhorii Hrebiniuk


    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.


    Grégory PLANCHAT

    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)

You must be logged in to reply to this topic.