dimanche 24 septembre 2017

Binding actions to a component helper fails if the component is changed dynamically

In a route lives a slide-out panel that shows a 'quick quote' workflow. This initially shows a default component, but the user can navigate back and forth through a bunch of steps.


    


Which component is displayed is determined by the 'qqComponent' property. The action 'navigateQuickQuotePanel' changes the value of 'qqComponent' based on passed parameters:

navigateQuickQuotePanel(component) {
    set(this, 'qqComponent', component);
},

This works fine initially and when the value of qqComponent changes, a new component is displayed. However, at that point it appears that the 'onNavigate' property, which should be pointing to the 'navigateQuickQuotePanel' action, is actually null (as the action does not seem to have been rebound to the new displayed component).

Any help in this regard would be appreciated, as binding properties in this manner works fine. For example, where I have the below and the displayed component modifies these properties directly, it works fine.


     


Please note the quick quote cannot be done through routes, as the overlay can appear over any route in the website.




Aucun commentaire:

Enregistrer un commentaire