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     [Case Opened] StyleSheet Link to JavaScript Function With WEBVIEWER ON Breaks.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Case Opened] StyleSheet Link to JavaScript Function With WEBVIEWER ON Breaks.
 Login/Join
 
Master
posted
The following code creates a report and displays it within the browser:
-*
-* Set up environment.
-*
APP PREPENDPATH IBISAMP
-SET &FMT = 'AHTML';
-*-SET &FMT = 'HTML';
-*
-* Create report.  
-*
TABLE FILE GGSALES
 PRINT SEQ_NO
 ON TABLE HOLD FORMAT &FMT
 ON TABLE SET WEBVIEWER ON
 ON TABLE SET WEBVIEWTARG _parent
 ON TABLE SET CACHELINES 200
 ON TABLE SET STYLE *
  TYPE = DATA, COLUMN=SEQ_NO, JAVASCRIPT=dodrilldown(SEQ_NO),
   COLOR=BLUE,
  $
 ENDSTYLE
END
-RUN
-*
-* Display report.  
-*
-HTMLFORM BEGIN
<html>
 <head>
  <title>My Title</title>
  <script language='javascript'>
   function dodrilldown(SEQ_NO) {
    alert('Sequence No =>' + SEQ_NO);
   }
  </script>
 </head>
 <body>
  !IBI.FIL.HOLD;
 </body>
</html>
-HTMLFORM END
-EXIT 

When I run the focexec, -SETting format to 'AHTML', the report renders fine, and the drill down link to the JavaScript function works AOK.

When I run the focexec, -SETting the format to 'HTML', the report renders fine, and the drill down link creates a JavaScript 'Object Expected' error.

When viewing the HTML report, if I click the 'All Pages' button, the drill down works. When I return to the Web Viewer, by clicking the 'back space' button, the links again stop working, yielding the JS 'Object Expected' error.

This message has been edited. Last edited by: David Briars,




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
 
Posts: 822 | Registered: April 23, 2003Report This Post
Platinum Member
posted Hide Post
Hi,
Since webviewer divides the HTML into multiple pages each page needs to have the Javascript embedded into it or have a reference to the js file....

here is one way of doing it.

  
APP PREPENDPATH IBISAMP
-*-SET &FMT = 'AHTML';
-SET &FMT = 'HTML';
-*
-* Create report.  
-*

DEFINE FILE GGSALES
JS1/A100 ='<script type="text/javascript" src="http://localhost:8080/approot/baseapp/js1.js"></script>' ;
END

TABLE FILE GGSALES
 PRINT SEQ_NO
HEADING
"<JS1"
 ON TABLE PCHOLD FORMAT &FMT
 ON TABLE SET WEBVIEWER ON
 ON TABLE SET WEBVIEWTARG _parent
 ON TABLE SET CACHELINES 200
 ON TABLE SET STYLE *

  TYPE = DATA, COLUMN=SEQ_NO, JAVASCRIPT=dodrilldown(SEQ_NO),
   COLOR=BLUE,
  $
 ENDSTYLE
END
-RUN
-EXIT




this way each page will have a pointer to the JS file in the baseapp ..

thanks
Sashanka


WF 7.7.03/Windows/HTML,PDF,EXL
POC/local Dev Studio 7.7.03 & 7.6.11
 
Posts: 103 | Registered: June 12, 2009Report This Post
Master
posted Hide Post
Thank you for the information and technique, Sashanka.

I can see were your technique would be valuable to others in a situation similar to mine.

Unfortunately, in my case, I really do need the -HTMLFORM code that surrounds the report itself.

In my actual case, that the fex in my first entry models, the JavaScript function called submits a Hidden Run Form.

Both the JavaScript function and the hidden run form are stored within the -HTMLFORM code.

This message has been edited. Last edited by: David Briars,
 
Posts: 822 | Registered: April 23, 2003Report This Post
Master
posted Hide Post
I've performed a 'view source' on the code behind the HTML Format/Webviewer scenario, and do not see any of my HTML and JavaScript code, from within the -HTMLFORM.

It is 'as if' WebFOCUS is doing a 'PCHOLD' instead of a HOLD, under the HTML/Webviewer combination. PCHOLD in the sense that the HOLD file is created, and then it is transferred to the browser.

I want the HOLD file created, without the 'automatic transfer', because I am inserting the report within a -HTMLFORM, via the !IBI.FIL command, in the next step of the fex.

This message has been edited. Last edited by: David Briars,
 
Posts: 822 | Registered: April 23, 2003Report This Post
Virtuoso
posted Hide Post
David, perhaps holding the report in either HTMTABLE format for HTML, or AHTMLTAB for AHTML may simplify your including them in the -HTMLFORM section as the resulting HTML will be more "compliant". Otherwise, you will end up with an <HTML> tag inside of another one which is not really a valid document (no matter how forgiving Internet Explorer is) and may make the Javascript functions a bit crazy when parsing the DOM.

-*
-* Set up environment.
-*
APP PREPENDPATH IBISAMP
-SET &FMT = 'AHTML';
-*-SET &FMT = 'HTML';

-SET &HOLDFMT = IF &FMT EQ 'AHTML' THEN 'AHTMLTAB' ELSE 'HTMTABLE';

-*
-* Create report and save resulting HTML table in a HOLD file  
-*
TABLE FILE GGSALES
 PRINT SEQ_NO
 ON TABLE HOLD AS HRESULT FORMAT &HOLDFMT
 ON TABLE SET WEBVIEWER ON
 ON TABLE SET WEBVIEWTARG _parent
 ON TABLE SET CACHELINES 200
 ON TABLE SET STYLE *
  TYPE = DATA, COLUMN=SEQ_NO, JAVASCRIPT=dodrilldown(SEQ_NO),
   COLOR=BLUE,
  $
 ENDSTYLE
END
-RUN
-*
-* Display report.  
-*
-HTMLFORM BEGIN
<html>
 <head>
  <title>My Title</title>
  <script language='javascript'>
   function dodrilldown(SEQ_NO) {
    alert('Sequence No =>' + SEQ_NO);
   }
  </script>
 </head>
 <body>
  !IBI.FIL.RESULT;
 </body>
</html>
-HTMLFORM END
-EXIT 



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Master
posted Hide Post
njsden,

Thank you for your reply.

I had tried HTMTABLE, and received the same JavaScript error. Apologies for not stating that in my original post.

Dave
 
Posts: 822 | Registered: April 23, 2003Report This Post
Virtuoso
posted Hide Post
Strange ... upon clicking View Source only <TABLE> ..... </TABLE> are shown, as if the web viewer took controlof the rest of the HTML document ... more playing is needed.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
Hmmm, that definitely seems to be the case ... no other content in the HTML document gets rendered as soon as the HOLD file containing the web viewer piece is added.

Though this does not help, at least it explains why your JavaScript is failing ... it just does not seem to be there anymore similar to the rest of the HTML document.

-HTMLFORM BEGIN
<html>
 <head>
  <title>My Title</title>
  <script language='javascript'>
   function dodrilldown(SEQ_NO) {
    alert('Sequence No =>' + SEQ_NO);
   }
  </script>
 </head>
 <body>
  <h1>My heading</h1>
  <br />
  !IBI.FIL.HRESULT;
  <br />
 </body>
</html>
-HTMLFORM END



Taking the WEB VIEWER settings makes the document behave as expected ...



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
By analyzing the content of the HTMTABLE file itself, I see this:

 <!--PAGING HTM-->
 <!--VIEWERTARG "_parent"-->
 <!--WEBVIEWHELP "ON"-->
 <!--WEBVIEWALLPG "ON"-->
 <!--VIEWERMULT "OFF"-->
 <!--WEBALLOFF "OFF"-->
 <TABLE BORDER CELLPADDING=1>
 <TR>
 <TD>
 <TABLE CELLPADDING=0 WIDTH="100%"><TR>
 <TD>
 PAGE     1</TD></TR></TABLE></TD>
 </TR>
 <TR>
 <TD ALIGN=RIGHT VALIGN=BOTTOM>
 Sequence#</TD>
 </TR>
 <TR>
 <TD ALIGN=RIGHT>
 <A HREF="javascript:dodrilldown('1');"><FONT COLOR="#0000FF">1</FONT></A>
 </TD>
 </TR>
 <TR>
 <TD ALIGN=RIGHT>
 <A HREF="javascript:dodrilldown('2');"><FONT COLOR="#0000FF">2</FONT></A>
 </TD>
 </TR>
 </TABLE>
 <!--PAGEND-->



However, once added into the -HTMLFORM statement along with the other pieces, Internet Explorer's "View source" only shows this:

<TABLE BORDER CELLPADDING=1>
<TR>
<TD>
<TABLE CELLPADDING=0 WIDTH="100%"><TR>
<TD>
PAGE     1</TD></TR></TABLE></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BOTTOM>
Sequence#</TD>
</TR>
<TR>
<TD ALIGN=RIGHT>
<A HREF="javascript:dodrilldown('1');"><FONT COLOR="#0000FF">1</FONT></A>
</TD>
</TR>
<TR>
<TD ALIGN=RIGHT>
<A HREF="javascript:dodrilldown('2');"><FONT COLOR="#0000FF">2</FONT></A>
</TD>
</TR>
</TABLE>


Plus a set of controls at the bottom of the page.

So, the parsing WebFOCUS must be doing on those "special" lines (<!--PAGING HTM-->,<!--VIEWERTARG "_parent"-->, etc. ) is creating some content in the HTML output that not only adds the "paging controls" at the bottom of the browser but also seems to take precedence or blow completely any other existing content not embedded between <!--PAGING HTM--> and <!--PAGEND-->.

This may be a harder one to hack Frowner



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
hi,

WF default WEBVIEWER will send out one HTML page at a time to the browser from the web server....only way to control this is to play around with the system vcpxxx.htm files in WF installation directory or create your own paging feature on the report ...

I am not sure of what your run form requires to accomplish but I tried my hand at coming up with something to start off with...
I know it is a very crude way of doing things.

  

This is the main fex file

-* Set up environment.
-*
APP PREPENDPATH IBISAMP
-*-SET &FMT = 'AHTML';
-SET &FMT = 'HTML';
-*
-* Create report.  
-*

DEFINE FILE GGSALES
JS1/A100 ='<script type="text/javascript" src="http://localhost:8080/approot/baseapp/js1.js"></script>' ;
END

TABLE FILE GGSALES
 PRINT SEQ_NO
HEADING
"<JS1"
 ON TABLE HOLD FORMAT &FMT
 ON TABLE SET WEBVIEWER ON
 ON TABLE SET WEBVIEWTARG _parent
 ON TABLE SET CACHELINES 200
 ON TABLE SET STYLE *

  TYPE = DATA, COLUMN=SEQ_NO, JAVASCRIPT=dodrilldown(SEQ_NO),
   COLOR=BLUE,
  $
 ENDSTYLE
END
-RUN

-*
-* Display report.  
-*
-HTMLFORM BEGIN
<html>
 <head>
  <title>My Title</title>
-*  <script language='javascript'>
-*   function dodrilldown(SEQ_NO) {
-*    alert('Sequence No =>' + SEQ_NO);
-*   }
-*  </script>
 </head>
 <body>

  !IBI.FIL.HOLD;
 </body>

</html>
-HTMLFORM END
-EXIT 

and here is the Javascript file JS1.js

 
   function dodrilldown(SEQ_NO) {
   
    alert('Sequence No => before submitting the form' + SEQ_NO);

   
  
var txtHtml = '<form name=form1 id=form1 method=post target=new  >';
txtHtml = txtHtml + '<type=hidden name=fld1 id=fld1 value="">';
txtHtml = txtHtml + '<type=hidden name=fld2 id=fld2 value="">';
txtHtml= txtHtml + '<type=hidden name="IBIAPP_app" id=IBIAPP_app value="baseapp">';
txtHtml= txtHtml + '<type=hidden name="IBIF_ex" id=IBIF_ex value="google_lat.fex"> </form>';



var prevHtml = document.documentElement.innerHTML;

document.write(txtHtml + prevHtml);


	document.getElementById("fld1").value = SEQ_NO;
	document.getElementById("fld2").value = SEQ_NO * 10;
document.form1.submit();	


}


it submitted the form alright ..


thanks
Sashanka


WF 7.7.03/Windows/HTML,PDF,EXL
POC/local Dev Studio 7.7.03 & 7.6.11
 
Posts: 103 | Registered: June 12, 2009Report This Post
Master
posted Hide Post
njsden - Thank you for examining this issue. Yes, it is as if my -HTMLFORM html/JavaScript code is removed upon rendering with the viewer, and then 'restored' upon clicking the viewer 'All Pages' icon.

All - I have opened a case with IB on this issue.
 
Posts: 822 | Registered: April 23, 2003Report This Post
Virtuoso
posted Hide Post
quote:
This may be a harder one to hack


quote:
... play around with the system vcpxxx.htm files in WF installation directory ...


I guess not for a true hacker Wink

Thanks Sashanka for the example. I'll try to find some time to play with it and see what you propose.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report 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     [Case Opened] StyleSheet Link to JavaScript Function With WEBVIEWER ON Breaks.

Copyright © 1996-2020 Information Builders