I'm trying to fire the Lifecycle events from Navcontroller as described in the Api docs
The problem is, that I just can fire these events by a parent component, sub components does not fire . Is there something I have to add/change, when I want to add these events to Subcomponents ?
(I think there is no code needed to undestand the problem)
System:
Ubuntu 16.04 /
Node 6.7.x /
npm 3.10.x /
ionic 2 rc0
An inner component knows nothing about Ionic lifecycle events. Ionic/pages will not notify inner components about loading, become the active page, etc. If you need your inner component to do something based on lifecycle events, tie the parent lifecycle event with the inner component using Angular's #ViewChild decorator.
In parent component get a reference to the child component using #ViewChild as explained here. Then, inside the parent lifecycle event, call a public function defined in child component.
Hope it helps,
Xavi
Related
Using a Flow inside a ViewModel and observing its state in a Compose function.
The ViewModel keeps listening to flow events even when compose screens are changed. (For Activities and Fragments we have lifecycle events to handle this).
One interesting point while using NavControllerHost for navigating to another compose screen, the state changed is not invoked inside the Composable function but in the ViewModel, the state is getting changed, whereas, when navigation is done without NavControllerHost, the state change callback is received in compose too.
Any suggestion to handle this gracefully?
We have a remote event receiver associated to a list and hooked on all events there. When you update any list item using OOB SharePoint page, the event receiver is executed; a web service which is taking care of the afterward actions works nicely. However when you update item use CSOM code e.g. in simple console application, nothing happens. The event receiver is not called at all. I found this issue on both SP 2013 and 2016.
I will not post any code while it is irrelevant: item is updated using standard approach and values are actually changed in the list item, only the event receiver is not fired. To put it simply:
item updated manually from site -> event receiver fired
item updated via CSOM -> event receiver not fired.
I remember similar issue on SharePoint 2010 when using server side code and system account. Could it be that behind the scene web service called by CSOM (e.g. list.asmx) is using system account to make changes as well? It's just hypothesis...
So after deeper investigation and many try/fails we found out it was indeed issue with code in our event receiver. For some strange reason original developers were checking Title field in after properties and cancelling code if not present. I guess it was probably an attempt to prevent looping calls.
One lesson learned: When using CSOM after event properties contains only those fields which were altered by CSOM code. Keep it in a mind in case you need to use other values than those you want to update. You may need to stupidly copy and assign them again just because of this.
Considering this example: http://emberjs.jsbin.com/hecewi/1/edit?html,js,output
The docs state that an action will be searched for on the controller first (which works in the example e.g. by pasting the actions hash into the IndexController), then on the current route and then along its parent routes until it hits ApplicationRoute. I'd expect the testCamel action in the example to be triggered then, but instead there is an error about the route did not get handled. How to do it right?
The code to trigger an action is indeed correct. It's just an unfortunate chosen example. Since your route will initialize the controller, the route itself is probably not completely initialized by the time the action is sent. If you, for example, schedule the action to be triggered in the following run loop, it works perfect:
http://emberjs.jsbin.com/yaseva/1/edit
I understand how to bind an action in a Backbone View to an event trigger but, how can you fire an action watching the condition that two precise envets have been triggered?
For that you can use jquery functionality like:
$.when(func1, func2).then(func3);
It acts like deffered and promise here.
I am working with the MVC architecture. I have my GUI all set up, and I have my controller using the model for data access. My question is: how do I set up bidirectional data flow between the controller and the GUI(view). I am using Qt, so When I hit a button, it will fire off an action. In order to make that Action fire off to the controller, I need an instance of it. Then from the controller side, I need an instance of the view so I can tell it how to behave. So, how can achieve this communication? Am I even on the right track? please let me know what you guys think.
Thanks
The view doesn't need to be explicitly aware of the controller. The controller can connect to any of the view's signals and the signals can relay relevant data or they can be empty. When the controller handles them in a slot, it can call methods on the view to fetch data if it isn't already included in the signal. The controller can also call any view method at any time.
I usually connect widget(button) signals directly to slots in the view class and expose custom aggregate signals that a controller can connect to instead of exposing all the widgets themselves.