PDA

View Full Version : Launching Drildown Page From a Drilldown Page and Bypassing Portal



rkanemeier
01-14-2011, 08:58 AM
I am having problems passing parms from a javascript function in first grid to a javascript function in the second grid. I created a cellclick listener that will call a javascript function which will open up a new window that in turn calls another web page that will generate the new grid, but the parms are undefined.

Here is the code inside of grid1 that calls the javascript to launch the new grid:



function launchCWFdetail (parmField,parmValue) {
alert('launchCWFdetail called with parmField = ' + parmField + ' and parmValue = ' + parmValue);
var CWFdetailURL = 'http://chc4001:7021/valence/vvlogin.pgm?user=GenRpt&password=MedMC&environment=1&option=1014&portal=false&parmField=' + parmField + '&parmValue=' + parmValue;
alert(CWFdetailURL);
var dtlTimeOutValue = 4000;
try{
this.CWFdetailWindow.loadDetail(this.parmField,thi s.parmValue);
} catch (e) {
this.CWFdetailWindow = window.open(CWFdetailURL,'CWFdetail','width=600,me nubar=1,status=1,personalbar=1,toolbar=1,resizable =1,location=0');
setTimeout("this.CWFdetailWindow.loadDetail(this.parmField,thi s.parmValue)",dtlTimeOutValue);
};

this.CWFdetailWindow.focus();
}


new Ext.Viewport({
layout: 'fit',
items: [{
xtype: 'grid',
id: 'grid01',
title: 'Please wait while drill down grid loads....',
store: dsGrid01,
stripeRows: true,
columnLines: true,
listeners:{
cellclick: function (grid,rowIndex, columnIndex,e){
var record = grid.getStore().getAt(rowIndex);
var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
var fieldData = record.get(fieldName);
//alert('Row: ' + rowIndex + ' Col:' + columnIndex + ' Field: ' + fieldName + ' Value: ' + fieldData);
launchCWFdetail(fieldName, fieldData);
}
},
.....


Here is the code for grid2:



// This function serves to circumvent the problem of launching another page
// from a Valance app outside the valence portal.
window.loadDetail = function(inField,inValue) {
alert('CWFDRILL04.html was called with inField=' + inField + ' and inValue=' + inValue);
dsClaimDetailGrid.baseParams = {
pgm: 'CWFDRILL04',
action: 'getRecords',
field: inField,
value: inValue,
limit: 25,
start: 0
};

Ext.getCmp('claimDetailGrid').setTitle('<div style="text-align:center">Claim Detail for </div>');
dsClaimDetailGrid.reload();
};


The values for parmField and parmValue are fine. I have a bad feeling I am running into problems with the window object since it is being used in both grids.

rkanemeier
01-14-2011, 02:30 PM
Sean helped me with this over the phone. For those of you with a similar problem, here is the solution.

The following code is supposed to call my new drilldown page:



function launchCWFdetail (parmField,parmValue) {
alert('launchCWFdetail called with parmField = ' + parmField + ' and parmValue = ' + parmValue);
var CWFdetailURL = 'http://chc4001:7021/valence/vvlogin.pgm?user=GenRpt&password=MedMC&environment=1&option=1014&portal=false&parmField=' + parmField + '&parmValue=' + parmValue;
alert(CWFdetailURL);
var dtlTimeOutValue = 4000;
try{
this.CWFdetailWindow.loadDetail(this.parmField,thi s.parmValue);
} catch (e) {
this.CWFdetailWindow = window.open(CWFdetailURL,'CWFdetail','width=600,me nubar=1,status=1,personalbar=1,toolbar=1,resizable =1,location=0');
setTimeout("this.CWFdetailWindow.loadDetail(this.parmField,thi s.parmValue)",dtlTimeOutValue);
};

this.CWFdetailWindow.focus();
}


We needed to create and assign variables within launchCWFdetail to pass to CWFdetailWIndow (see changes in bold):



function launchCWFdetail (parmField,parmValue) {
this.inField = parmField;
this.inValue = parmValue;
alert('launchCWFdetail called with inField = ' + inField + ' and inValue = ' + inValue);
var CWFdetailURL = 'http://chc4001:7021/valence/vvlogin.pgm?user=GenRpt&password=MedMC&environment=1&option=1014&portal=false&inField=' + inField + '&inValue=' + inValue;
alert(CWFdetailURL);
var dtlTimeOutValue = 4000;
try{
this.CWFdetailWindow.loadDetail(this.inField,this. inValue);
} catch (e) {
this.CWFdetailWindow = window.open(CWFdetailURL,'CWFdetail','width=600,me nubar=1,status=1,personalbar=1,toolbar=1,resizable =1,location=0');
setTimeout("this.CWFdetailWindow.loadDetail(this.inField,this. inValue)",dtlTimeOutValue);
};

this.CWFdetailWindow.focus();
}