Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Changing fex Target in XML Request

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Changing fex Target in XML Request
 Login/Join
 
Member
posted
I'm using a javascript within an html launch page to direct the selection data to 1 of 2 graph focexecs. I'm getting an extra character '[' passed and I haven't figured out how this is happening.

Here's my code:

ibif_ex = document.getElementById("IBIF_ex");
ItemP = form.PGM.selectedIndex;
Program = form.PGM.options[ItemP].value;
_______________________________________________
if (Program == 'MACGR490' )
{
alert(ibif_ex.value)
ibif_ex.value = 'app/macgr490test.fex'
alert(Program)
alert(ibif_ex.value)
}
else
{
alert(ibif_ex.value)
ibif_ex.value = 'app/macgr491test.fex'
alert(Program)
alert(ibif_ex.value)
}
OnExecute(ctrl)
}
_______________________________________________

The alerts show the value change correctly but I get the following message:

This name may not contain the '[' character:

-->[<--object]

___________________________________________
The error is showing up in this IBI script:

function ExecuteRequest(requestElt)
{
var request = null;
var variables = null;
var targetName = requestElt.getAttribute('targetname');
var target = document.getElementsByName(targetName)[0];
var targetType = requestElt.getAttribute('targettype');

var sourceType = requestElt.getAttribute('sourcetype');
var source = requestElt.getAttribute(ibif_ex); <<----------------------<<<<< ERROR is pointing to this statement.

________________________________________

Any ideas on how I am getting the '[' character or how to edit it out?

Thanks, Lou

This message has been edited. Last edited by: Kerry,


7.6.5
IBM Mainframe
DB2 and DataWarehouse
 
Posts: 1 | Registered: January 23, 2009Report This Post
Virtuoso
posted Hide Post
quote:
ibif_ex = document.getElementById("IBIF_ex");
...
var source = requestElt.getAttribute(ibif_ex);


ibirls2 and 3 .js declare ibi_ex as a string:
var ibif_ex = "ibif_ex";
but you overrode that with
ibif_ex = document.getElementById("IBIF_ex");
making it an object. The getAttribute() method expects a string as its argument.

The "[" is a red herring; perhaps an ascii-to-ebcdic mistranslation of ^.

- - -

On second thought -- "[" might be the lead character of ibif_ex.toString()

This message has been edited. Last edited by: j.gross,
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
quote:
Lou Corlis
Hi Lou Corlis,

Did you come up with a solution of setting that value of ibif_ex?

I would like to do the same thing but I haven't been successfull yet!

Thanks

Mark


WebFocus 765. iSeries v5r4
 
Posts: 175 | Location: England | Registered: April 11, 2006Report This Post
Expert
posted Hide Post
Mark,

If you want to set the value of the fex to be executed according to the value held in a combo, then just -
  document.getElementById("IBIF_ex").value = document.getElementById("combobox1").value;

Using a selct something like -

              <select class="paramControl" id=combobox1 name=Source >
               <option value="R1558_Script1c.fex">Input VAT
               <option value="R1558_Script1b.fex">Output VAT
              </select>

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Hi Tony,

Thanks. In my simple test today I was just trying to hardcode the value, but setting it via a combo box will be what I eventually use.

However the part I am not sure of is whats needs to change in the syntax of the XML request.

As default it was:

ibif_ex="app/mark.fex"

Now that ibif_ex's value is being set elsewhere, what should I change it to? Everything I seem to try just stops the report from being called and nothig happens when I click the run button?

Thanks

Mark


WebFocus 765. iSeries v5r4
 
Posts: 175 | Location: England | Registered: April 11, 2006Report This Post
Expert
posted Hide Post
Mark,

If you look at the SELECT I gave above, you will see that the fex name is passed as the value from the selected combo item. The "document.getElementById("IBIF_ex").value = document.getElementById("combobox1").value" will place the current value from combobox1 into the IBIF_ex control for when you submit the form.

If, as it would appear, you want to target fexes from the domain folder then just prefix with "app/".

Reading further, I guess that you are using the GUI? I don't actually use it (yes, really Wink) and therefore I am not readily conversant with the structure. However, PM me with your code and I'll try and spot the changes you need.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
The GUI uses XML request list to run a procedure.
In my example I have a dropdown that selects which report to run in the iframe.
The first button runs Report 1 in the iframe.
The first button runs Report 2 in the iframe.
We will only be using the click event of the first button to run a report.
The click event of the first button checks to see which report is selected in the REPORT dropdown and runs its corresponding procedure.

After we get the report working properly we set the visibility of the second button to hidden.

Hope this helps.

  
<!-- Generated by Report Layout Painter -->
<HTML>
<HEAD>
<SCRIPT id=IBI_RelCallBack type=text/javascript>function AdjustChildrenPosition(){
}
</SCRIPT>

<SCRIPT id=IBI_OptionsScript type=text/javascript>
var rltVersion = "764";
var cgipath = "cgipath";
var ibirls = "ibirls2";

var rltdyncalendar = "rltdyncalendar";
var gmap = "ibigmap";
var olap="olap";
var olappanebase="olappanebase";
var olapdrill="olapdrill";

var ibixmltree="ibixmltree";

var ibiOptions = new Array(cgipath,ibirls);
</SCRIPT>

<SCRIPT id=IBI_nls src="/ibi_html/javaassist/nls.js" type=text/javascript></SCRIPT>

<SCRIPT id=IBI_ibigbl src="/ibi_html/javaassist/ibi/html/js/ibigbl.js" type=text/javascript></SCRIPT>

<SCRIPT id=IBI_ibigblloadCss type=text/javascript>
ibigblloadCss(null);</SCRIPT>
<TITLE>HtmlPage</TITLE>
<SCRIPT id=clientEventHandlersJS type=text/javascript>
//Begin function window_onload
function window_onload() {
     UpdateData();
}

function button0_OnClick(ctrl) {
// TODO: Add your event handler code here

    var selectItem = document.getElementById("REPORT");
    var selectIndex = selectItem.selectedIndex;
    var selectValue = selectItem.options[selectIndex].value;

    var selVal = selectValue;


    if ( selVal == "0" ){
         var obj = document.getElementById("button0");
         OnExecute(obj);
    }
    else if ( selVal == "1" ){
         var obj = document.getElementById("button1");
         OnExecute(obj);
    }
    else {
         return false;
    };

}

//Begin function button1_OnClick
function button1_OnClick(ctrl) {
// TODO: Add your event handler code here
OnExecute(ctrl)
}
//End function button1_OnClick
</SCRIPT>

<SCRIPT for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto" edaconnectionrequired="true">
<SPAN id=pane4 style="Z-INDEX: 14; LEFT: 150px; WIDTH: 154px; POSITION: absolute; TOP: 50px; HEIGHT: 51px" tabIndex=14 elementtype="32" name="CAR" ElementToPaste="true">
<SELECT id=combobox2 style="Z-INDEX: 15; LEFT: 0px; WIDTH: 154px; POSITION: absolute; TOP: 29px" tabIndex=15 size=1 name=combobox2 sourcetype="typeMaster" datatype="1" requiredfield="1441954" boundtovariable="1" datasource="car.mas" selectedvalue operation accept="0" addalloption="0" datafield="CAR" displayfield="CAR" ibiformat="A16" dfformat="A16" defaultlocation="29,0,51,154"></SELECT>CAR
<SELECT id=CAR style="Z-INDEX: 16; LEFT: 0px; WIDTH: 154px; POSITION: absolute; TOP: 29px" tabIndex=16 size=1 name=CAR ElementToPaste="true" sourcetype="typeMaster" datatype="1" requiredfield="1441954" boundtovariable="1" datasource="car.mas" selectedvalue operation accept="0" addalloption="0" datafield="CAR" displayfield="CAR" ibiformat="A16" dfformat="A16" defaultlocation="29,0,51,154" newchainnumber="0" chainnumber="0" inchainindex="2" cacheruntimedata="1"></SELECT></SPAN>
<INPUT language=javascript id=button0 style="Z-INDEX: 23; LEFT: 460px; WIDTH: 80px; POSITION: absolute; TOP: 80px; HEIGHT: 40px" onclick=button0_OnClick(this) tabIndex=23 type=button size=14 value="Run Report" name=button0 ElementToPaste="true" requests_list="0">
<INPUT language=javascript id=button1 style="Z-INDEX: 24; LEFT: 550px; VISIBILITY: hidden; WIDTH: 110px; POSITION: absolute; TOP: 130px; HEIGHT: 40px" onclick=button1_OnClick(this) tabIndex=24 type=button value=Button1 name=button1 requests_list="1">
<IFRAME id=iframe1 style="Z-INDEX: 22; LEFT: 40px; WIDTH: 450px; POSITION: absolute; TOP: 170px; HEIGHT: 270px" tabIndex=22 name=iframe1 WIDTHOLD="450" HEIGHTOLD="270"></IFRAME>
<SPAN id=pane3 style="Z-INDEX: 17; LEFT: 40px; WIDTH: 100px; POSITION: absolute; TOP: 50px; HEIGHT: 51px" tabIndex=17 elementtype="32" name="COUNTRY" ElementToPaste="true">COUNTRY
<SELECT id=COUNTRY style="Z-INDEX: 18; LEFT: 0px; WIDTH: 100px; POSITION: absolute; TOP: 29px" tabIndex=18 size=1 name=COUNTRY ElementToPaste="true" sourcetype="typeMaster" datatype="1" requiredfield="1441954" boundtovariable="1" datasource="car.mas" selectedvalue operation accept="0" addalloption="0" datafield="COUNTRY" displayfield="COUNTRY" ibiformat="A10" dfformat="A10" defaultlocation="29,0,51,100" newchainnumber="0" chainnumber="0" inchainindex="1" cacheruntimedata="1"></SELECT></SPAN>
<SPAN id=pane1 style="Z-INDEX: 19; LEFT: 320px; WIDTH: 154px; POSITION: absolute; TOP: 50px; HEIGHT: 51px" tabIndex=19 elementtype="32" name="CAR">REPORT
<SELECT id=REPORT style="Z-INDEX: 20; LEFT: 0px; WIDTH: 110px; POSITION: absolute; TOP: 29px" tabIndex=20 name=REPORT>
<OPTION value=0 selected displaytext="REPORT1">REPORT1</OPTION>
<OPTION value=1 displaytext="REPORT2">REPORT2</OPTION></SELECT></SPAN></SCRIPT>  
<INPUT id=layoutinfo style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden inputcontrolids="combobox2;CAR;COUNTRY;REPORT">
<INPUT id=ibiapp_app style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden value=testing name=ibiapp_app>
<SCRIPT id=IBI_ChainScript type=text/javascript>
<!--
window.chain0=new Array(1);
window.chain0[0]=new String("COUNTRY;CAR");
window.chain0[1]=1
//--></SCRIPT>
<xml id=ibi_requests>
<script>

<requests>

<request requestid="0" sourcetype="typeFex" targettype="iframe" targetname="iframe1" ibif_ex="car_compose_a.fex" ibic_server="EDASERVE" activereport="0" reportcolumns="" ibiapp_app="testing">

<variables>

<variable parametercreatedinreslay="0" displayfield="COUNTRY" format="" field="COUNTRY" file="car.mas" desc="COUNTRY" datatype="0" operation="" default="" name="COUNTRY" textvarname="" accept="0" type="unresolved" select="0" min="" max="" controltype="7" create="1"></variable>

<variable parametercreatedinreslay="0" displayfield="CAR" format="" field="CAR" file="car.mas" desc="CAR" datatype="0" operation="" default="" name="CAR" textvarname="" accept="0" type="unresolved" select="0" min="" max="" controltype="7" create="1"></variable></variables></request>

<request requestid="1" sourcetype="typeFex" targettype="iframe" targetname="iframe1" ibif_ex="car_compose_b.fex" ibic_server="EDASERVE" activereport="0" reportcolumns="" ibiapp_app="testing">

<variables>

<variable parametercreatedinreslay="0" displayfield="COUNTRY" format="" field="COUNTRY" file="car.mas" desc="COUNTRY" datatype="0" operation="" default="" name="COUNTRY" textvarname="" accept="0" type="unresolved" select="0" min="" max="" controltype="7" create="1"></variable>

<variable parametercreatedinreslay="0" displayfield="CAR" format="" field="CAR" file="car.mas" desc="CAR" datatype="0" operation="" default="" name="CAR" textvarname="" accept="0" type="unresolved" select="0" min="" max="" controltype="7" create="1"></variable></variables></request></requests></script>
</xml></BODY>
<SCRIPT id=IBI_loader type=text/javascript>
doBeforeLoad();
</SCRIPT>
</HTML>


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Member
posted Hide Post
Based on a code sample from GIZMO, the following javascript will allow me to access the XML information, including the fex. The alerts indicate that the 'ibif_ex' attribute has been set properly, however, when I click the run button, it still executes the original fex??? Note that I am using version 7.6.9 and the XML id tag was ibi_requests in prior versions, but in 7.6.9, it is focus_xmlelement.

// get the xml data
var ibiXML = document.getElementById('focus_xmlelement');
// get the request object
var request = ibiXML.selectSingleNode("//requests/request");
alert(request.getAttribute('ibif_ex'));
request.setAttribute('ibif_ex','app/my_new_fex_name.fex');
alert(request.getAttribute('ibif_ex'));


WebFOCUS 7.7.02 Teradata, Oracle
Windows
Outputs: HTML / PDF / Excel
 
Posts: 13 | Location: Michigan | Registered: December 09, 2008Report This Post
Platinum Member
posted Hide Post
Hi Tony,

Thanks, I had actually already understood what the combo was acheiving and what would be required to include the domain, I was just unsure of the XML part. I am also new to the GUI; up until a month ago we used to just edit the existing HTML. However I have now discovered some pretty cool stuff since trying the GUI out on a new screen!


Mighty Max,

Thank you very much for the example, it was very useful! I see that instead of trying to change the XML code and the report it is going to call it is using a method I hadn't considered....To effectively have two run buttons, one hidden and one visible, and when the visible one is pressed the code decides which button to trigger based on the report selected in the drop down box. This will do for me!!

Cheers Smiler


WebFocus 765. iSeries v5r4
 
Posts: 175 | Location: England | Registered: April 11, 2006Report This Post
Guru
posted Hide Post
Steve,

Your solution works fine in 7.68. Tested it in MRE and Self-Service.

I made a javascript function using your solution.
  
function xmlReport() {
// TODO: Add your event handler code here

    var selectItem = document.getElementById("REPORT");
    var selectIndex = selectItem.selectedIndex;
    var selectValue = selectItem.options[selectIndex].value;
    var selVal = selectValue;

    // get the xml data
    var ibiXML = document.getElementById('ibi_requests');
    // get the request object
    var request = ibiXML.selectSingleNode("//requests/request");

    if ( selVal == "0"){
        request.setAttribute('ibif_ex','app/car_compose_a.fex');
    } else if ( selVal == "1" ){
        request.setAttribute('ibif_ex','app/car_compose_b.fex');
    };
}


Then all I do is call the function in the event that executes the report. In this case the onSubmit for the form.
  
onsubmit="xmlReport();OnExecute(this);return false;"


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Member
posted Hide Post
Hi Steve - I just tried your solution in 7.6.10 and it does not appear to work. The getAttribute and setAttribute work fine (confirmed from alert pop-up boxes), but ibif_ex does not seem to get passed correctly to the WFServlet. Have you seen this behavior?
 
Posts: 2 | Location: Denver | Registered: February 12, 2004Report This Post
Member
posted Hide Post
As I mentioned in my post on July 22, I was not able to get this to work with version 7.6.9.

We are currently developing our launch pages manually without all of the MRE added code. This gives us complete control over the launch page, allowing us to change a form's target via javascript whenever we would like.


WebFOCUS 7.7.02 Teradata, Oracle
Windows
Outputs: HTML / PDF / Excel
 
Posts: 13 | Location: Michigan | Registered: December 09, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Changing fex Target in XML Request

Copyright © 1996-2020 Information Builders