How can i reuse a view from another application to my current application in sapui5 - sap-fiori

I want to reuse a view of another sapui5 application (suppose xyz app) to my current sapui5 application ( suppose abc app), and i don't have idea how to achieve this. I have read something like jQuery.sap.registerModulePath() to register the components, but i am not getting idea how to implement. Please help me out. Thanks in advance.

First you register a lib with that function. Then you use require to load it. https://help.sap.com/saphelp_nw74/helpdata/en/91/f23a736f4d1014b6dd926db0e91070/content.htm

Related

Post on a different page in ruby on rails

I have been trying to solve a problem for some time in ruby on rails, but I haven't been able to achieve it and I can't seem to find a solution online (it must be easy but I am not sure what is the write thing to search for)
So, in my web application, I have a CURD table and I use modal to create new items in there:
Image 1
Image 2
This is working perfectly fine. What I would like to do is that when this is created I'd like to post in a different page that " ABC have been created by X User"
In my case that would be the chatbox container:
Image 3
So in my case, the green box is where I would like to say of what has been created and who has created it. I know that it is not a complex problem but I just can't seem to find the solution and I have been trying this for days.
Would really appreciate your help. Please let me know if you don't understand the problem and I can elaborate.
Thanks in advance.
Kind Regards,
Usman
You can create a separate model Notification (or similar name), and use an after_create hook in your original model to automatically create an instance of Notification. The Notification could store the information you want to display as attributes. From there, you'd have to figure out how to display the notification in the correct place on the 3rd page. One approach would be to query all your posts and notifications and sort them by created_at. There's other ways, it's up to you.
I get what you're saying.. but I am a little confused on the first part. So I have a model called Solr that has all the records associated with its User. What do I put in the after_create hook method to display records according to the timestamp in my Chat Box/ Events Log? Do you have an example of a similar implementation?
PS - Why do you say that I need to create a new model why can't I use the same model?
Thanks.

iOS Swift 3 "Login" apps: Best Method for storing/passing a User

I was simply wondering what the best practice(s) were for passing/storing a User (I created a custom "User" class) when using a login-type application? I am trying to pass the appropriate logged-in user from the login screen to the rest of the application(embedded in a tab bar) or store it appropriately.
Any help is greatly appreciated!
Using a singleton is a tested (and my method-of-choice) practice when it comes to storing something like a user.
This link here should be a good starting place for you!
This link is more relevant for swift.

What is the best way to externalize the static items used in iOS app?

I am working on app where I have country object and I will be having around 200 instances of object. Each object will have few properties like flagName, capitalCity etc.. I started working on prototype using only 10 countries and I stored these objects inside the viewDidLoad method as an arrays. I know its not a good practice to "hard code" everything in the source code. In a real app, I would like to externalize these static items and put them in a file or database or somewhere else. What is the best way to store such information ? I am thinking of property list but if the data-model changes then I will have to re-submit the app. Any help would be greatly appreciated. Thanks
Try to load a JSON file from your web site. Create a simple JSON model, hide the file on your web site and have the app load it from there. If you want to change it, you just have to change the JSON file on your server. This way you won't have to re-submit the app.
Cache the content of the file in your app so it can work off line, if needed.
Just a suggestion.

How to Change/update grails view (gsp) from service class

I have a Grails Application, which has a self implemented chat system. Now I am trying to refresh the sit ( or the box containing the messages in particular), as soon as a new Message arrived. So far I figured out three methods:
Poll from DB every second (every incoming message is saved to DB), which would be the easiest, but create a lot of unneccessary DB usage
Update the view from within the Messagelistener. I dunno how to do this though, what I am looking for is kind of the remoteFunction-tag as a function to call from within a service.
Update the view from domain class via beforeInsert-event. This is my least favourite option, plus I don't know how to do it for the same reasons as option 2.
If someone has a better option or a way to realize one of mine I would be very thankful :)
try http://vertx.io/ out. It's easy to setup and should do just fine for asynch-messaging

WindowsPhone not refresh/update listbox

i m writing an app where i has created an web service in local network.I m able to grab resources provided by service in android, wp7.1 and ios5.
But i faces a problem, in wp7.1 and ios5 in refreshing the list box and the uitableview controller respectively.
Actually the data source get update in both of this platform but it didn't refresh/update the view which is very important.
if any expertize knows about my problem in depth please help me out from this.if any body has sample code related to updating the view according to the web service kindly help.
i have a solution for this problem in wp7.
may be your web service call fetches the data from catch for the same service call.
try to add current time to show your web service request as new one.
like ".....?&currenttime=...."
try this.
You mention both view and controller so I'm guessing you are using some form of MVVM pattern.
For the controller to update the view a number of things must happen:
The controller must be the DataContext for the view. Most MVVM frameworks handle this plumbing for you.
The controller property that the listbox in the view is bound against must have NotifyPropertyChanged called or must be an ObservableCollection.

Resources