Focal Point
[WORKAROUND] URL button generates bad URL

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4837075816

April 03, 2012, 11:27 AM
Wep5622
[WORKAROUND] URL button generates bad URL
I have a launch page with a dropdown list in it and a button. The hyperlink for the button is set to execute an URL, with the parameter from aforementioned dropdown list.

Say the dropdown list is named 'PARAM' and the URL to execute is '/approot/URLTEST.htm'.
Now if I push the button, an URL is generated: '/approot/URLTEST.htm?&PARAM=test'

Yup, it adds '?&' instead of just '?'. Sigh.

That's an invalid URL that JQuery (it's url plugin, to be exact) cannot parse!
Is there a fix for this?

And yes, of course I can work around this bug ...again...

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


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
April 04, 2012, 04:03 AM
Wep5622
Added a simple test-case using the CAR database:
<!-- Generated by Report Layout Painter -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META id=mycharsetmeta content="text/html; charset=ISO-8859-1" http-equiv=Content-Type>
<META id=Generation content="Created in release 7611, Generation 3.0">
<SCRIPT id=IBI_RelCallBack type=text/javascript>function AdjustChildrenPosition(){
}
</SCRIPT>

<SCRIPT id=IBI_OptionsScript type=text/javascript>
var cgipath = "cgipath";
var ibirls = "ibirls3";

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 type=text/javascript src="/ibi_html/javaassist/nls.js"></SCRIPT>

<SCRIPT id=IBI_nlsVars type=text/javascript src="/ibi_html/javaassist/nlsvars.js"></SCRIPT>

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

<SCRIPT id=IBI_ibigblloadCss type=text/javascript>
ibigblloadCss(null);
addIntlTranslatedJS("composertrans.js");
</SCRIPT>
<TITLE>HtmlPage</TITLE>
<SCRIPT id=clientEventHandlersJS type=text/javascript>
//Begin function window_onload
function window_onload() {

UpdateData();

// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
}
//End function window_onload

//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>

<META name=GENERATOR content="MSHTML 8.00.6001.19190"></HEAD>
<BODY style="OVERFLOW: auto" persistentuniqueid="compUid_1" nextelementuniquenumber="3" elementtype="21" edaconnectionrequired="true">
<SELECT style="Z-INDEX: 1; POSITION: absolute; WIDTH: 172px; TOP: 18px; LEFT: 18px" id=combobox1 tabIndex=1 persistentuniqueid="compUid_2" defaultselection="1" name="CAR"></SELECT>
<INPUT style="Z-INDEX: 2; POSITION: absolute; TOP: 17px; LEFT: 199px" id=button1 language=javascript tabIndex=2 onclick=button1_onclick(this) value=Button type=button persistentuniqueid="compUid_3" defaultselection="1" requests_list="0" name="button1">
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=layoutinfo type=hidden>
<INPUT style="POSITION: absolute; TOP: -100px; LEFT: -100px" id=ibiapp_app value="alban general ibisamp ibiwork masters_voice baseapp" type=hidden name="ibiapp_app">
<xml id=focus_xmlelement>
<script type="text/xml">
<rootxmlnode top="100" left="10" width="150" height="130">
<variables>
<variable controltype="7" name="CAR" parametercreatedinreslay="1" top="70" left="30" width="60" height="20" inbinding="1" type="" desc="CAR" default="" textvarname="" accept="0" select="0" create="1">
<link linktype="default" from="compUid_2">
<condition default="1" name="Default" whattodowithcontrol="4" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0">
<data_info sourcetype="typeMaster" ibiformat="A50" displayfield="CAR" datafield="CAR" datasource="" datatype="0" selectedvalue="" operation="" slider_range_from="" slider_range_to=""></data_info></condition></link>
<requestid id="0"></requestid></variable></variables>
<input_controls>
<input_control bindcontrolid="compUid_2" elementtype="8" name="CAR" id="combobox1" multiple="0" top="20" left="30" width="60" height="20" inbinding="1" onetimepopulated="0">
<link linktype="default">
<condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0" conditionmultiselectoperator="0">
<data_info sourcetype="typeMaster" datatype="1" selectedvalue="" displayfield="CAR.COMP.CAR" ibiapp_app="alban general ibisamp ibiwork masters_voice baseapp" datasource="car.mas" ibiformat="A16" dfformat="A16" datafield="CAR.COMP.CAR" modifiedrequest="0" accept="0" addalloption="0" operation="NONE">
<![CDATA[TABLE FILE car
SUM FST.CAR.COMP.CAR
 BY CAR.COMP.CAR
-*insert_filters_here
ON TABLE PCHOLD FORMAT XML
END
]]></data_info></condition></link></input_control></input_controls>
<other_bound_objects></other_bound_objects>
<requests nextrequestsid="0">
<request requestid="0" sourcetype="typeUrl" targettype="window" targetname="_blank" ibif_ex="bad_url.htm" activereport="0" reportcolumns="" ibiapp_app=""></request></requests></rootxmlnode></script>
</xml></BODY>
<SCRIPT id=IBI_loader type=text/javascript>
doBeforeLoad();
</SCRIPT>
</HTML>


Push the button and notice that the URL ends with "bad_url.htm?&CAR=ALFA%20ROMEO" instead of "bad_url.htm?CAR=ALFA%20ROMEO".


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
April 04, 2012, 05:11 AM
Wep5622
I found a workaround by adding a hidden input field before adding the dropdown list and making both fields URL parameters.

That way the hidden input field becomes the first URL parameter (invalid) and the field I need becomes the second and can be read out by JQuery!

This is a workaround though, not a fix. Until IBI fixes this issue, the above will work.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
April 04, 2012, 09:56 AM
ABT
kill two birds with one stone and make the invalid amper parm the date/time. The parm will still be ignored (as it should be) and generate a unique URL to avoid caching.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro