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.
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.
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, LouThis message has been edited. Last edited by: Kerry,
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, 2005
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, 2006
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 ) 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, 2004
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.
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, 2008
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
WebFocus 765. iSeries v5r4
Posts: 175 | Location: England | Registered: April 11, 2006
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.
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, 2004
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, 2008