Focal Point
URL gets truncated in Javascript
January 23, 2008, 01:05 PM
Norb EckertURL gets truncated in Javascript
Hi All,
I am trying to do a drilldown from a cell on a table that I made in the HTMLFORM section of a fex. The table looks great and I hooked a little code like this on the cell: onmouseup="runDrill()". runDrill just contains this:
var myUrl = "http://webfocus/ibi_apps/WFServlet?IBIAPP_app=otc&IBIF_ex=trendgr01";
window.open(myUrl, "mywindow");
After running the report and clicking on the cell I got an error on the HTML report page. I viewed the source and see that the url for the drilldown has been truncated at the ampersand. Consequently I can't open the window and run the drilldown report - not to mention the paramters that need to be passed as well.
How can I get past this problem?
Thanks,
Norb
prod:7.6.9, win2k3 mre, caster, bid, devstudio 7.6.9
January 23, 2008, 01:11 PM
smithsNot sure if your URL is legal.
Mine are always like:
http://webfocus/ibi_apps/WFServlet?IBIF_ex=trendgr01ie) IBIF_ex component right after '?', with no preceding '&'.
Then all amper variables are appended at the end.
Sean
------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
January 23, 2008, 01:19 PM
Francis MarianiWhenever you use an ampersand in the HTML portion of a fex, you need to code it like this &| - this is to prevent Dialogue Manager from assuming it's a DM variable.
Instead of this:
var myUrl = "http://webfocus/ibi_apps/WFServlet?IBIAPP_app=otc&IBIF_ex=trendgr01";
Try this:
var myUrl = "http://webfocus/ibi_apps/WFServlet?IBIAPP_app=otc&|IBIF_ex=trendgr01";
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 23, 2008, 01:22 PM
Alan BNorb
If this is run from a fex, then WF will see the & and think it's an &variable.
Use &| (& followed by the concat symbol).
Alan.
WF 7.705/8.007
January 23, 2008, 02:27 PM
Norb EckertWell you little geniuses were right again! I did the concatenation and it works. Thank you.
However, next I tried to pass a single parameter and I it doesn't work! I could just start crying!
This is the url from the source HTML file:
http://webfocus/ibi_apps/WFServlet?IBIAPP_app=otc&IBIF_...gr02&USERID='957244'When I copy it into the browser address bar it executes correctly. But this doesn't happen when I click on the cell to use the window.open() function. I also built the url without the single quote around the variable values. Any more ideas? I'm so close to the solution that I can taste it.
Thanks,
Norb
prod:7.6.9, win2k3 mre, caster, bid, devstudio 7.6.9
January 23, 2008, 02:35 PM
Norb EckertHOLD IT! STOP THE PRESSES!
I tracked down some offensive javascript variables, promptly booted them out and now this thing runs!
Woo Hoo! Party on Garth!
Thanks for everyone's assistance, thoughts, and prayers.
Norb
prod:7.6.9, win2k3 mre, caster, bid, devstudio 7.6.9