SAP UI5 Transition Parameters - transition

I am using SAP UI5 for a while and thank you all your answers about ui5, it helped me much.
I want to learn what the transition parameters is, i have two views and app. Using to function for the navigation between them. But i want slow transition, it happening very fast.
In the to function there is oTransitionParameters parameter but i don't know how to set it.
Here is the code i'm using to show second view but it is not slowed the transition :
app.to(izinView,"flip",null,"duration:'slow'")
Hope somebody know it.

The answer to your question is in the last sentence of the comment for the sTransitionName parameter:
https://openui5.hana.ondemand.com/#docs/api/symbols/sap.m.NavContainer.html#to
None of the standard transitions is currently making use of any given
transition parameters.
You can also see in the source code for sap.m.NavContainer it is not being used:
/*, oTransitionParameters is unused */
However, that being said you could monkey patch the the sap.m.NavContainer.transitions object with your own custom animation.
sap.m.NavContainer.transitions["slowFlip"] = {
// definition here
};
To look at the current implementation of "flip" see here:
https://github.com/SAP/openui5/blob/master/src/sap.m/src/sap/m/NavContainer.js#LC1202

Related

How to *include* a model in multiple views / structs in SwiftUI xcode

This is a very noob question. I'm proficient in css, but swift is new to me and so I am trying to think object based, but it's not natural yet. I have tried to understand MVVM which I think is core to the problem but I'm not sure so asking for help.
I want to create an app which has an 'index' central nav type view which I have put in contentview. Depending on what button is pressed I want it to invoke series of functionality but there are up to 9 different types of function that are entirely independent of each other. In html / css, I'd have a central nav index and 'link' to other function specific capabilities.
I don't want to repeat code, so I am trying to work out how to create an architecture that supports it. Where I am getting stuck is in the scoping of it as it is telling me 'this variable isn't in scope'. Fine. I understand the concept but not how to do it right. And I've watched hundreds of hours of video and still not found anything. As an illustration, say the contentview was main actor, and it was a navigator for topics on cats, dogs, lizards, snakes, horses, and pigs.
My thinking is that I'd keep contentview as the nav, and have separate swift files cat.swift, dogs.swift, lizards.swift etc and include them into contentview so their content was globally available. In each of those files I'd have the let catName = etc and much more content specific to that function area. But then from within cat.swift I'd also want to include dog.swift, horse.swift etc as well so the user can navigate those too. In css I'd do this via links - which is probably utter idiocy in swift.
So how do I do this in swiftUI? I don't in detail know the detailed differences between #stateObject, and #state and private var versus var etc and have tried to find a guide that says 'if you want 'catModel' to be available throughout the app define it anywhere with #makeitavailableeverywhere catModel and just trigger it into the view you want by '#include catModel'.
Not sure if this makes sense, but if someone can point me to where I can get accessible, translation into how to do this I'd be so grateful. The app is nearly complete - and I'm pleased, I just can't get the different .swifts to be in scope to each other.
Thank you!

Use Comment In UI

I want to use UE4's comment function in the UI window of my personal project. It has been implemented to some extent, but there is a problem with Z-order. We put one Canvas and added a comment on it, but there is no problem setting the Z-order in the comment itself. When I put a new comment or something else on top of it, I want to set the Z-order of the title part of the comment and the box part below it differently.
Z-ordering of comments in any Blueprint is based on the order of creation.
Slate is slow enough, lets not try to add to the delay.
While the C++ code has a z-order argument, exposing it as a configurable object would add additional delays.
Design your code on paper first (as my first programming teacher taught me to do), then implement it.
Why should the existing code be modified to match your programming style?
Otherwise:
Simply delete all commented blocks and reorganize...

Loop over a view's controls in SAPUI5

I would like to know whether there is a way to loop over all the controls in a view (or all controls under a specific control) in SAPUI5. I'm looking for an analog to the vanilla JS document.body.querySelectorAll('*') function.
The closest thing I know of would be the View class's getControlsByFieldGroupId method but that would require me to tag all elements in the view, which I'd rather not. I've looked in the API reference to no avail.
Is there some clean way to do this in SAPUI5 1.71?
Thanks in advance for your input!
Joshua Schroijen
You can try: YourViewInstance.findAggregatedObjects(true); which will return all the aggregated controls.

How to pass a View to my ViewModel so an I*Service can use that View to do something

https://github.com/brianchance/MvvmCross-UserInteraction is a very nice plugin for showing cross platform Alerts!
But for this question, can we assume it can not use a UIAlertView (or some other top level MessageBox type call on other platforms) but needs to show a Message within a given subsection of the screen (i.e. on IPhone you would need to supply a UIView to the plugin which it will use to show the message within).
So, how would you set this up so the ViewModel knows what View to use as its display container?
As a specific example, if I wanted an Error Service, as so -
public interface IErrorPFService
{
void Show();
void Hide();
void SetErrors(List<Error> errors);
}
and I create a platform specific implementation for it.
If I inject this into my ViewModel so it can control Error Show/Hide/Set how do I tell it the UIView (or equivalent) that I want my Errors to show within?
Can I just expose the IErrorPFService field as a public property and do -
MyViewModel.ErrorPFService = new ErrorPFService(View);
in my ViewDidLoad ...
Or is this coupled incorrectly vs Mvvm Practice?
I would expect the ViewModel to subscribe itself to the ErrorService.
When receiving a message it would expose it in a collection(?) and the View would bind to that collection.
This way the View is unknown to the service and the ViewModel has the chance to influence the View contrary to your solution.
It would help if you could give an example for the scenario you are describing.
Sometimes, the way you visually want to display something might not be the best way, so if it's possible for you, you might find a different and simpler way, which spares you from having to find a solution regarding what you are describing.
Generally, I always do the best I can to avoid the idea of having to actually pass a 'view' or an abstraction of it, from the view-model to view. Also, cross-platform wise, things can work very different in terms of UI interaction. You can find yourself in a situation when things are complicated just because UI works differently than what you expected.
But let's try find another perspective:
At any given point, the view knows what data \ feature it's displaying. So when you are calling from the view-model an user interaction action (by a service, property change, event, etc) the view should 'expect' it.
For example, the platform specific user interaction implementation is able to get the currently displayed top-view and interact it in a platform specific manner or based a relationship. In your example, the message-box can be displayed in a specific sub-view of the top level view.
In advanced scenarios, I guess you could try to create a cross-platform approach for this, but you should try to put in balance all the abstraction you want to create just for that. Think about doing this as a plan ... Z. If possible. Again, giving an example might help.

Creating reusable widgets

I`m using asp.net mvc 2.0 and trying to create reusable web site parts, that can be added at any page dynamically.
The problem I have is how to load a partial view with all related js and data? Ive tried the following ways to do that:
Use partial view and put all the js into it. In main view use render partial. But to initialize partial view I need to add model to current action method model to be able to make RenderPartial("MyPartialView", Model.PartialViewModel).
Also I do not have a place to put additional data I need to fill my form(like drop down lists values, some predefined values etc).
Use RenderAction, but it seems it have same problems as RenderPartial, except for I do not need to add anything to any other model.
Any other oprions are greatly appreciated.
As I understand it, RenderAction performs the full pipeline on the action, then renders the result - so what is rendered is the same as what you'd see if you'd browsed to the action.
I've used RenderAction to render 'widgets' throughout a site, but in my view they should be independent of the page rendering them, otherwise they're not really widgets and should be part of the rendering page's code instead. For instance, if there's a log in form, you will always take the user to a page that can process the information, no matter what page they are currently on, so this makes for a good widget. Other ways I've used it is to show a shopping basket or advertising. Neither of which are dependent on the page being shown.
Hope this helps a little!