SAPUI5-How to create custom Split Page control - sapui5

I want to create a custom split -like page control.This page should contain two areas left and right content with different width.How to create this type of page as a custom control?
Please help me with this.

Use a Splitter: https://openui5.netweaver.ondemand.com/#test-resources/sap/ui/commons/demokit/Splitter.html
the relevant parameters for you are:
new sap.ui.commons.Splitter("splitterId", {
splitterOrientation : sap.ui.commons.Orientation.Vertical,
splitterPosition : "50%",
minSizeFirstPane : "0%",
minSizeSecondPane : "0%",
firstPaneContent : yourLeftContents,
secondPaneContent : yourRightContents
})

Related

Flutter Razorpay not displaying image (logo) on checkout options

I am integrating Razorpay in Flutter, I have done all the things successfully but I am getting problem to show image (logo) on checkout dialog of Razorpay.
What I have done is:
var options = {
"key" : "rzp_test_123123123123",
"amount" : 100,
"name" : "Sample App",
"image" : "assets/logo.png",
"description" : "Payment for the some random product",
"prefill" : {
"contact" : "2323232323",
"email" : "shdjsdh#gmail.com"
},
"external" : {
"wallets" : ["paytm"]
}
};
try{
razorpay.open(options);
}catch(e){
print(e.toString());
}
The output that I am getting is:
Can anyone please tell me what will be the right string to give as a path in the image key?
I have pasted an image in the assets folder directly.
I tried hosting the image and then was able to load it.
"image" : "https://razorpay.com/assets/razorpay-glyph.svg"
I know this is a workaround but again if you wish to pass this image dynamically you won't be having this file saved in your app, rather would need to load it dynamically from a URL.
In case you wish to set up a fixed logo, u can do the same logging into razorpay.com -> setting -> Configurations.

SAP UI5 Cross Application Navigation without FLP

I have two apps. The first app has a view. There I push a button and then it should change to the second application. I don't want to navigate to the first view, but to the second with a parameter.
I use this:
oCrossAppNavigator.toExternal({
target : {
semanticObject : "Z_APP2",
action : "onPress"
},
params : {
param1 : param1
}
In APP2 I write this in the Component.js:
var oRouter = this.getRouter().initialize();
var oComponentData = this.getComponentData();
if (oComponentData.startupParameters) {
oRouter.navTo("Detail", {
param1 : oComponentData.startupParameters.param1[0],
}, false);
It doesn't switch to the other app. Which action should I write here ?
Do I have to implement something else in App2?
The answer is:
window.location.replace("-- url with parameters here --")
The right system is : window.location.host
I have a same issue.
SAPUI5 provide sap.m.URLHelper which contains redirect method :
sap.m.URLHelper.redirect(sURL, bNewWindow?)
I think SAPUI5 do the same thing than window.location.replace() but more SAPUI5-friendly.

Hiding UI element from fragment.xml in standard App

I want to hide few UI elements from My Travel and Expense (Standard App). I have tried in different approaches but I am not able to achieve what i want. Here is my requirement:
In My Travel and Expense App (TRV_TE_CRE), I want to hide the following UI elements:
GenericClaim.fragment.xml - Button id="costAssignmentButton"
I have added the extension project for TRV_TE_CRE and tried as below:
In component.js I added the following statement to hide
customizing:
{
"sap.ui.viewModifications": {
"mytravelandexpense.view.GenericClaim": {
"costAssignmentButton": {
"visible": false
},
},
},
Result: not working
Extended the GenericClaim.controller.js:
I added the below code in hookmethod
this.byFragmentId("costAssignmentButton").setVisible(false);
Result : whole claim page is not loading
By using access key I have commented the UI code in GenericClaim.fragment.xml
Result : not getting hide
Instead of the fragment ID, you can access the element ID from the view. Add this method in your view controller.
onAfterRendering : function(){
var buttonToHide = this.getView().byId("costAssignmentButton");
buttonToHide.setVisible(false);
},

Change SliderDrawer Icon

whats I need to do to change the icon on top left? (SmartFaceIcon)
SliderDrawerIcon
You should use dynamic slider drawer for the first page and you can define it in Global.Smartface.js, such as :
var mySliderDrawer = new SMF.UI.SliderDrawer({
position : SMF.UI.SliderDrawerPosition.left,
icon : "myicon.png"
});
Pages.Page1.add(mySliderDrawer);
For other pages, you can use both dynamic or static and change the icon simply before you show the page. If you use static, you can change its icon as below :
Pages.Page2.SliderDrawer1.icon = "myicon.png";
Pages.Page2.show();
Be sure you set your icon(myicon) in the resource folder.

How to implement the Multi Flow pattern?

In the SAPUI5/OpenUI5 documentation's part "Application Best Practices - Preparing" is mentioned the Multi Flow Pattern. (https://openui5.hana.ondemand.com/#docs/guide/f377376842914da7a6716192ecffc9d0.html - it's almost at the bottom)
I need to implement this pattern but have absolutely no idea how to go on about it.
Do I need to replace the component's "root view" parameter?
Or do I need to replace the App control in App.view.xml? And how would I do that?
Or do I need to navigate to a view with a splitApp control? Thus placing a splitApp inside the App control? Can I then adjust the routes in the router accordingly? And how would I go on about that?
I am currently following the implementation as shown in "Best Practices", so I use the component and router and xml views for my application.
I'd be happy about any help or pointer to the right direction. Thanks in advance!
(And, yes, I already googled extensively, alas, complex examples are rare and hard to find. Yet.)
Byebye, Cleo
So after a few days fiddling around and a push in the right direction from #TobiasOetzel, I came up with this solution. It is based on the tdg example, and uses the router in a component, and xml views.
Component:
rootView : "my.ui5.multiflow.view.App",
[...]
routes : [
{
pattern : "",
name : "_index",
view : "Main",
targetAggregation: "pages",
targetControl : "idAppControl",
},
{
pattern : "foo",
name : "_foo",
view : "SplitContainer",
targetAggregation : "pages",
targetControl : "idAppControl",
subroutes : [
{
pattern : "foo",
name : "foo_sub1",
view : "Master",
targetAggregation : "masterPages",
targetControl : "idSplitContainerControl",
subroutes : [
{
pattern : "foo",
name : "foo_sub2",
view : "Detail",
targetAggregation : "detailPages",
},
{
pattern : "foo/foo/:all*:",
name : "foo_sub3",
view : "Detail2",
targetAggregation : "detailPages",
}]
}]
}]
App.view looks like this:
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
displayBlock="true"
xmlns="sap.m">
<App id="idAppControl" />
</mvc:View>
SplitContainer.view looks like this:
I had to give it a height, as otherwise the content would be hidden. By default the height is a 100% but that apparently does not help rendering it/showing it. (The same behaviour btw. with a tile container in an icon tab bar.) But that is another problem that I'll solve another time.
<mvc:View
xmlns:mvc="sap.ui.core.mvc"
displayBlock="true"
xmlns="sap.m">
<SplitContainer
id="idSplitContainerControl"
height="500px"
/>
</mvc:View>
So what do I do with these routes: when initially calling the app, the App control gets instantiated ("idAppControl"). The view "Main" is placed into the "pages" aggregation of the App control.
When navigating to myApp.html#/foo/ three things happen:
the view "SplitContainer" is being loaded into the "pages" aggregation of the App control. Now we have something similar to a split app.
the view "Master" is being loaded into the "masterPages" aggregation of the split container from 1.
the view "Detail" is being loaded into the "detailPages" aggregation of the split container from 1.
The view for the route "foo_sub3" can be loaded by navigating with this.getRouter().navTo("foo_sub3") or with myApp.html#/foo/foo/ or myApp.html#/foo/foo/somethingElse
Very helpful was http://scn.sap.com/community/developer-center/front-end/blog/2014/02/17/nested-ui-routing-in-openui5 though I ended up not using anything from his proposed changes.
And the SDK samples in openui5-sdk-1.22.10\test-resources\sap\ui\core\samples\routing
I welcome any corrections and/or suggestions for improvements.
I managed to adapt the SAPUI5 tutorial app using the following Flow with routing:
F – F – MD D D – F
(F = FullScreen; M = SplitApp MasterPage; D = SplitApp DetailPage)
Dropbox link
Thank you Cleo
to implement it you need an app and a split container inside of it.
I did a simple sample with a fullscreen page and a master/detail + buttons to navigate
http://jsbin.com/fikocuxiloha/3/
best regards
Nice one #TobiasOetzel :-)
I modified the navigation so that it slides back rather than forward, from the fullscreen back to the master-detail
fullscreen = new sap.m.Page({
title : "fullscreen",
content : new sap.m.Button({
text : "to master detail",
press : function () {
app.back() // modified line
}
})
});