December 14, 2006, 04:29 PM
tglaserPassing fex names from html
We used to pass the fex name to call from HTML using a format similar to this (GT and LT are left and right carats, respectively):
GT input type="hidden" name="IBIF_ex" value="FEXNAME" LT
The syntax in 7.1.4 is this:
GT request requestid="1" sourcetype="typeFex" targettype="1" targetname="_blank" ibif_ex="FEXNAME" ibic_server="EDASERVE" ibiapp_app="FOLDERNAME" LT
I am trying to pass a variable determined by user selection to ibif_ex, so one fex or another may be called to generate a report.
If the FEXNAME to be called is represented by the variable name selReport (populated by a javascript function), is it possible to pass this to ibif_ex? I have tried:
ibif_ex="selReport" -- passes selReport name and not its' contents, as you would expect.
ibif_ex=selReport -- the form is broken and no longer submits
ibif_ex="+selReport+" -- returns a "WebFOCUS was called with an invalid request" error. My thought was that the + might allow the interpretation of the variable's contents. It doesn't.
Has anyone else tried to do this, or tried another way, successfully?
I need to call a particular fex from the user form and pass a list of dynamic values in such a way that the html can be opened up by HTML Painter in the future without custom code being over-written by HTML Painter. I'm out of ideas except for passing everything off to a fex and letting DM take the appropriate action.
Thanks.
December 14, 2006, 05:22 PM
tglaserWell, we have a solution.
Where the value to be passed is in an option list such as this (the value is the fex name):
GT OPTION value='susser_recon_north' displaytext="NORTH PLANTS" LT NORTH PLANTS
Have a JS function call the value and set the attribute of ibif_ex with it.
function test2(ctrl) {
if(!ctrl)
ctrl = document.getElementById();
var arrRequests = GetRequestsList(ctrl);
if(arrRequests)
{
for(var j=0; j < arrRequests.length; j++)
{
var request = arrRequests[j];
if(request)
var source = request.getAttribute(ibif_ex);
var SelVal = REGION.options[REGION.selectedIndex].value;
request.setAttribute(ibif_ex, SelVal);
var zsource = request.getAttribute(ibif_ex);
}
}
The value goes to ibif_ex, the form submits and the fex runs. Life is good.
GT request requestid="1" sourcetype="typeFex" targettype="1" targetname="_blank" ibif_ex="" ibic_server="EDASERVE" ibiapp_app="sys_wholesale" LT
Thanks to Jeff, Java Scripter extraordinaire, for the solution. Hopes this helps some of you out there if you have something similiar going on.