rclay
09-21-2009, 03:37 PM
Well, my first test program isn't working. Debug shows:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>403 Forbidden</TITLE>
</HEAD><BODY>
<H1>Forbidden</H1>
Forbidden - by rule.
<P>You do not have permission to access /valence/RCTEST
on this server.</P>
</body></html>
It looks like an authority problem but
I made the the authority match the other programs in library VALENCE20.
Why is it looking in /valence instead of /valence20?
Thanks for any insight.
Robert
richard.milone
09-21-2009, 03:40 PM
can you post your front-end html program?
rclay
09-21-2009, 03:52 PM
It's ugly but it's just bare-bones as a test:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Copyright" content="Copyright © 2008-2009 CNX Corporation, All Rights Reserved">
<title>Valence Examples - Layouts - Border Layout</title>
<link rel="stylesheet" type="text/css" href="/extjs/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="/vvresources/valence.css" />
<script type="text/javascript" src="/extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/extjs/ext-all.js"></script>
<script type="text/javascript" src="/vvresources/valence.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
// global variables
var mode = '';
var currentRecord = new Ext.data.Record();
Ext.form.Field.prototype.msgTarget = 'under';
// Internal data store;
// Holds distinct SECUSER values from table webusersec
var dsRecords = new Ext.data.JsonStore({
autoLoad: true,
// url: 'vvcall.pgm',
url: 'RCTEST',
remoteSort: true,
root: "WEBUSRSEC",
totalProperty: "totalCount",
fields: ['SECUSER']
});
// Column model
var colModel = new Ext.grid.ColumnModel([
{header: "<b>User Name</b>", sortable: true, locked:false, width: 100, dataIndex: 'SECUSER'}
]);
// This is a generic Valence function to enable a field.
// (It may be copied and reused in any Valence program
// without modification or dependencies).
var enableField = function(field) {
var getField = Ext.get(field);
var getCmpField = Ext.getCmp(field);
getField.dom.style.border='1px solid #B5B8C8';
getField.dom.style.color='black';
getField.dom.style.opacity='1';
getField.dom.style.filter='alpha(opacity=100)';
getField.dom.readOnly='';
getCmpField.resumeEvents();
};
// This is a generic Valence function to disable a field.
// (It may be copied and reused in any Valence program
// without modification or dependencies).
var disableField = function(field) {
var getField = Ext.get(field);
var getCmpField = Ext.getCmp(field);
getField.dom.style.border='0px';
getField.dom.style.color='black';
getField.dom.style.opacity='.65';
getField.dom.style.filter='alpha(opacity=75)';
getField.dom.readOnly='true';
getCmpField.suspendEvents();
};
// Function to enable the specified user name
var enableRec = function() {
Ext.getBody().mask('<B>Enabling...</B>', 'x-msg-loading');
if (mode=='edit') {var action='enableRec'};
Ext.Ajax.request({
url: 'vvcall.pgm',
params: {
pgm: 'RCTEST',
action: action,
secuser: Ext.getCmp('SECUSER').getValue()
},
success: function(response) {
var check = response.responseText;
if (check) {
var data = Ext.util.JSON.decode(response.responseText);
if (data.SUCCESS=='1') {
dsRecords.reload();
Ext.getCmp('viewport').layout.setActiveItem(0);
} else {
f=Ext.getCmp(data.FLD);
f.markInvalid(data.MSG);
f.focus();
};
Ext.getBody().unmask();
};
},
failure: function(response) {
Ext.getBody().unmask();
}
});
};
// grid definition
var gridRecords = new Ext.grid.GridPanel({
autoScroll: true,
trackMouseOver: true,
loadMask: true,
title: 'Detail',
header: false,
region: 'center',
store: dsRecords,
cm: colModel,
frame: false,
bbar: new Ext.PagingToolbar({
pageSize: 25,
store: dsRecords,
displayInfo: true,
displayMsg: 'Showing records {0} - {1} of {2}',
emptyMsg: "No records to display",
plugins: [new Ext.ux.vvPagingToolbarPlugin()]
}),
keys: [{
key: Ext.EventObject.ENTER,
fn: function() {
gridRecords.getBottomToolbar().changePage(1);
dsRecords.reload();
}
}]
});
// viewport
new Ext.Viewport({
id: 'viewport',
layout: 'card',
activeItem: 0,
items: [gridRecords]
});
// listener: set grid call parameters
dsRecords.on("beforeload", function() {
dsRecords.baseParams={pgm: 'RCTEST', action: 'getRecs'};
});
// context menu: grid right-click
var contextMenu = new Ext.menu.Menu({
id: 'contextMenu',
items: [
{text: 'Enable', iconCls: 'edit', handler: function() {enableRec('edit')}}
]
});
// listener: context menu for grid
gridRecords.on("rowcontextmenu", function(grid, rowIndex, e) {
e.stopEvent();
currentRecord=grid.getStore().getAt(rowIndex);
gridRecords.getSelectionModel().selectRow(rowIndex );
var xy = e.getXY();
contextMenu.showAt(xy);
});
// listener: row click to enable
gridRecords.on('rowdblclick', function(grid, rowIndex, columnIndex, e) {
currentRecord=grid.getStore().getAt(rowIndex);
getRec('edit');
});
// since the viewport has a card layout set the initial card to be displayed (grid)
Ext.getCmp('viewport').layout.setActiveItem(0);
});
</script>
</head>
<body>
</body>
</html>
I really don't understand what I'm doing but I'm using the cusmaint.html example as a template to learn.
Thanks for your help.
Robert
rclay
09-21-2009, 04:14 PM
I edited the option and added RCTEST as an authorized program for the option (I was missing that--sorry!) but it still doesn't work: it churns and churns but results in no records. I may have something wrong on the RPG side?
Robert
sean.lanktree
09-21-2009, 04:17 PM
Robert -
Can you check both the "Post" and "Response" in firebug (post them here if possible)? Do you have any message waiting under the Valence20 server instance?
richard.milone
09-21-2009, 04:20 PM
The first thing to do would be to put the vvcall.pgm back on the url in the dsRecords JsonStore. When calling an RPG program you always call vvcall.pgm, unless you're trying to run something outside the portal. vvcall in turn will launch the program specified by your pgm parameter.
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.