FIORI: display PDF file sent from the Gateway - sapui5

I'm working on this Fiori app (both ABAP and UI5 parts). I have to send a PDF file from the back-end server to the Fiori app and then display it in a new tab whenever the user pushes a button.
I have no idea how to implement this. Searching on the internet, I found examples that explains the ABAP part but not the Fiori part (and conversely ).
Does any one please have a full example implementing this scenario ?
Thanks in advance :)

<Button press="openPDF" text="Open PDF"></Button>
openPDF : function(){
var URL = "https://www.sapfioritrial.com/sap/opu/odata/sap/HCM_MY_PAYSTUBS_SRV/PDFPaystubs(SEQUENCENUMBER=1694,PersonnelAssignment='00100226')/$value";
sap.m.URLHelper.redirect( URL, true )
}
The example from SAP demokit can help you
PDF Viewer

There is a dedicated control for it and is part of the UI5 library. The control is: PDFViewer. You can read more in here: https://sapui5.hana.ondemand.com/#/api/sap.m.PDFViewer/overview
I found also some blog which explain how to do it with smart forms that may help you.
https://blogs.sap.com/2014/04/23/sapui5-pdf-viewer-smartforms-custom-control/

Related

application with sapui5 and openui5

Actually we have developed on application with sapui5 for our customer but the problem is that some new customer dont want to go through License agrement with sapui5. So the solution we have found to make our application with openui5.
My question is that
"Is there any possibility to make application with both of them and at the time of installation making a decision either going and make resources of sapui5 or openui5"?
Thank you
Nimi
As long as you understand that certain features will only be available in SAPUI5 you can load the version of sap-ui-core.js that comes with either in your bootstrap index.html page.
For example, if using CDN, for OpenUI5 link to https://openui5.hana.ondemand.com/resources/sap-ui-core.js and for SAPUI5 use https://sapui5.hana.ondemand.com/resources/sap-ui-core.js
See this link to read about differences between SAPUI5 and OpenUI5.
Also see this link for another discussion of the differences.
I know that this post (I'm linking to) is not so much updated but it will give you a good overview and history about SAPUI5/OpenUI5 and all the differences.
Anyway, SAPUI5 is a superset of OpenUI5 with some addictional control (like VizChart or FilterBar.
I think that in 90% of cases you can just go with OpenUI5 and use other opensource libraries / develop custom control if you need something that is missing.

How to appear the arrow using sap.m.Popover

I'm using SAPUI5
I allready create de Object Sap.m.popover, and appears on bottom of the button when click, but the arrow up its not there.
What i miss?
Thanks
Its due to missing of CSS. Please try to update the UI5 library. 1.28.7 version is recommended. Thanks
There are API properties for controlling the arrow positioning (placement) and it also depends on the device / browser how the arrow is displayed.
If the examples from the explored app or from the test page run fine for you, then try to copy the code from one of these resources:
Examples
Developer Test page
If this does not help, consider opening a new GitHub issue for OpenUI5 or an SAP ticket to analyze the issue.

Google web toolkits - multiple pages

On the google website there an example of a simple GWT appliatoin, following is a link:
http://code.google.com/webtoolkit/doc/1.6/tutorial/create.html
The above application has a host page:StockWatcher.html
and StockWatcher.java is the entry point.
If I wanted to add more html pages to this application, we keep one single host page and the entry point will add different panels depending on which link the user clicked on? In this case, how to know which link the user clicked on? If I create a navigation panel and each link has a request parameter, then after the user clicks on the link, How to get the request parameter?
Are there any tutorials available online on how to create a fully functional application? The one example google provides is too simple.
Thanks so much in advance
You have two options to have multiple page web application using gwt.
1) Use gwt history feature and listen for the history change. In this approach at the initial page load itself browser downloads all the javascripts(Including the widgets which are not useful in current link). Still this can be avoided by using gwt code splitting.
2) Create multiple modules. In this case you have to create multiple html pages and GWT entry points. For each major functionality create a gwt module and link that with [modulename].html file. In this approach browser downloads only particular feature's javascript. Not all the javascripts.
Based on your application requirement you can pick one of the option. IMHO I would suggesst second option.

Embedding Google Docs (-like) functionality

I'm looking for a way to embed Google Docs itself--or a Google Docs-like real-time collaboration of text documents--into a web platform built with Vaadin on top of Google Web Toolkit. Currently our users won't be creating Google IDs and, ideally, we wouldn't need them to (if embedding Google Docs itself). Thanks in advance!
Could you embed the document in an iframe as shown here? (in 5.17.3 Browser Frames)
If you just need a text editor, another solution can be to embed tinymce within you GWT client:
http://tinymce.moxiecode.com
We did it on our project and it works perfectly

Access to hyperlink in a pdf(iPhone)?

I am working on a small app, which can open a pdf. My question is, if it is possible to access a hyperlink from a pdf? Because when am trying to click on hyperlink nothing is happening and it's not redirecting me to the link. I tried searching a lot but didn't got any luck on this. Am expecting a quick response as my work is getting delayed because of this issue. If it's possible then what would be the approach? Right now am using UIWebView to open the pdf. Any sample app or code will be of great help.
Thanks for your time .
The only way I know is to use a third party library (or perhaps parse the PDF yourself), find the links, get their rects and catch user taps and compare that to the list of link/hyperlinks/gotos for that particular page.
Unfortunatelly - nothing in the SDK that can help. You can search for a opensource pdf library, like muPDF for instance.
There is a reason why not many applications have that functionality :D