We have several mobile applications where one application should be able open another another application using using "Valence.util.App.Launch(launchObj)". Using a browser the application will launch the other application correctly. When using the mobile application on an iPad or iPhone, the initial mobile application opens. It does not seem to work on the Valence Mobile application. Both applications are checked in Include in Portal (Desktop & Mobile) Valence App Admin portal. Both will open correctly when directly selected. It seems that the Valence.util.App.Launch may not be enabled in the mobile portal. Thanks for your help in advance.
Announcement
Collapse
No announcement yet.
Opening up multiple Valence Mobile apps
Collapse
X
-
If you run the example application "Mobile Portal Actions" and tap the item Launch Active Sessions does it launch the Active Sessions application in the mobile portal?
Example source on how the Mobile Portal Actions application launches Active Sessions:
Code:Valence.util.App.isRunning({ app : 97, scope : me, callback : function (response) { if (!response) { Valence.util.App.launch({ app : 97 }); } else { Valence.common.util.Dialog.show({ title : 'Launch', msg : Valence.lang.lit.activeSessions + ' is already running', buttons : ['->', { text : Valence.lang.lit.ok }] }); } } });
-
Sorry for the slow response back. Yes, I tried your example and it does launch. I see a few differences that I am using parms, and I am not using scope or callback.
Income Statement Code:
onIncomeGrid_ItemClick: function(dataview, record, item, index, e, eOpts) {
// console.log("hello");
if(record.get('CSS') !== 'detail'){
Ext.Msg.show({
title : 'Income Statement',
msg : 'Drill down not available for this line item',
icon : Ext.Msg.INFO,
buttons : Ext.Msg.OK
});
}else{
if(Valence.util.App.isLaunched(1020)){
Valence.util.App.close(1020);
}
var acct = record.get('ACCT'),
comp = Ext.ComponentQuery.query('#incomegrid_comp')[0].getValue(),
dept = Ext.ComponentQuery.query('#incomegrid_dept')[0].getValue(),
// App 1020 is the Pgm ID in Valence
launchObj = {
app: 1020,
params: {
comp : comp,
dept : dept,
period : this.period,
year : this.peryear,
acct : acct
}
},
launcher = setTimeout(function(){
// console.log(launchObj);
// the 500 is milliseconds or 1/2 second.
Valence.util.App.launch(launchObj);
}, 500);
}
},
Comment
-
When running in the native mobile portal you need to pass a callback to isRunning as shown in the 5.1 docs. Is running should be used instead of is launched.
Here is an example based on the source you posted, however, I wasn't able to test it of course.
Code:onIncomeGrid_ItemClick: function (dataview, record, item, index, e, eOpts) { if (record.get('CSS') !== 'detail') { Ext.Msg.show({ title : 'Income Statement', msg : 'Drill down not available for this line item', icon : Ext.Msg.INFO, buttons : Ext.Msg.OK }); } else { var acct = record.get('ACCT'), comp = Ext.ComponentQuery.query('#incomegrid_comp')[0].getValue(), dept = Ext.ComponentQuery.query('#incomegrid_dept')[0].getValue(), app = 1020, // App 1020 is the Pgm ID in Valence isNativePortal = Valence.mobile.Access.isNativePortal(), launchObj = { app : app, params : { comp : comp, dept : dept, period : this.period, year : this.peryear, acct : acct } }, contFnc = function (isRunning) { if (isRunning) { Valence.util.App.close(app); } // the 500 is milliseconds or 1/2 second. // setTimeout(function () { Valence.util.App.launch(launchObj); }, 500) }; if (isNativePortal) { // Since running in the native mobile portal we need to pass a callback to isRunning // Valence.util.App.isRunning({ app : app, callback : function (isRunning) { contFnc(isRunning); } }); } else { // Not running in the native portal no need for a callback // contFnc(Valence.util.App.isRunning(app)); } } }
Comment
Comment