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] Active Report - How to Turn Off Context Menu Upon Click Within Report.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CASE-OPENED] Active Report - How to Turn Off Context Menu Upon Click Within Report.
 Login/Join
 
Master
posted
How can I turn off the Context Menu that appears within an Active Report, upon clicking a cell?

Below is some code that 'turns off' the menu, by displaying an Alert Box. It appears that the Alert Box supercedes the popup Context Menu.

  
-******************************************************************************
-* Focexec     : CheckProto
-* Purpose     : Checkbox Prototype - Support Checkboxes within AHTML.
-* Author      : D. Briars
-* Date Written: 07/21/11
-* Revisor     :
-* Date Revised:
-* Comments    : None.  
-* Inputs      : GGPRODS - IBI Test File.
-* Output      : AHTML 
-* Parms       : None.
-******************************************************************************
-** Set up environment.
-******************************************************************************
APP PREPENDPATH IBISAMP
-RUN
-******************************************************************************
-** Create AHTML/Checkboxes.
-******************************************************************************
DEFINE FILE GGPRODS
 CHK_BOX/A100 = '<input type="checkbox" value="CBX' || PRODUCT_ID || '"' ||
                ' onclick="donothing()"'  ||
                '>';
END
-*
TABLE FILE GGPRODS
PRINT PRODUCT_ID
      CHK_BOX AS ''       
      PRODUCT_DESCRIPTION
ON TABLE HOLD AS ACTREPT FORMAT AHTML
ON TABLE SET STYLE *
     INCLUDE = nfa,
$
-* Set lines per page, and location of paging object.
 TYPE=REPORT,
-*      FONT='ARIAL', SIZE=11,
-* Show all results on one page.
      LINES-PER-PAGE=UNLIMITED,
	  OBJECT=STATUS-AREA,
-* Turn off pagination bar.
	  PAGE-LOCATION=OFF,
	  JUSTIFY=CENTER,$
ENDSTYLE
END
-RUN
-******************************************************************************
-** Display HTML/AHTML Reports.
-******************************************************************************
-HTMLFORM BEGIN
<html>
<head>
<title>Multi Checkboxes</title>
<script language=javascript>
//
// Function: donothing 
// Purpose : Attempts to remove row selected context menu, upon row click.  
//
function donothing() {
// my_window = window.open("",
//       "mywindow","status=1,width=350,height=150");
// my_window.document.write('<h1>The Popup Window</h1>');
// my_window.close();
//
 alert("Note that Context Menu, does not appear.");
//
//document.getElementById("dummy").click();
//document.getElementById("dummy").focus();
//document.getElementById("dummy").blur();
}
//
// Function: CheckAllCheckNone
// Purpose : Check all/Uncheck all Checkboxes, upon button click.
//
function CheckAllCheckNone(toggle) {

    var elLength = document.MyForm.elements.length;

    for (i=0; i < elLength; i++)
    {
        var type = MyForm.elements[i].type;
        var position = MyForm.elements[i].value.indexOf("CBX");
        if (type=="checkbox" && position >= 0 && (toggle)) {
            MyForm.elements[i].checked = "checked";
        }
        else if (type=="checkbox" && position >= 0 && !(toggle)) {
            MyForm.elements[i].checked = "";
        }
        else {
        }
    }
}
//
// Function: CheckCheckBoxes
// Purpose : Scroll through checkboxes, creating an array of Product Id's, for each
//           slected checkbox box.
//
function CheckCheckboxes(){
    var elLength = document.MyForm.elements.length;
    var aryCheckBoxes = new Array();
    var cntrCheckBoxes = 0

    for (i=0; i < elLength; i++)
    {
        var type = MyForm.elements[i].type;
        var position = MyForm.elements[i].value.indexOf("CBX");

        if (type=="checkbox" && MyForm.elements[i].checked && position >= 0){
            aryCheckBoxes[cntrCheckBoxes] = MyForm.elements[i].value.substr(3,4);
            cntrCheckBoxes++
        }
        else {
        }
    }

    var holdit = "Array of Product Id(s): "
    for (i=0; i < aryCheckBoxes.length; i++)
    {
      holdit = holdit + ' ' + aryCheckBoxes[i];
    }
    alert(holdit);
}
</script>
</head>
-*
<body>
<form name="MyForm">
-* Insert active report.
!IBI.FIL.ACTREPT;
-* Display buttons.
<input value="Get Values"  type="button" onClick="CheckCheckboxes();">
<br><br>
<input value="Reset" type="reset">
<br><br>
<input value="Select All" type=button onclick="CheckAllCheckNone(true);">
<br><br>
<input value="Unselect All" type=button onclick="CheckAllCheckNone(false);">
<br><br>
<input value="Dummy" type="button" name="dummy" id="dummy">
-*
</form>
</body>
</html>
-HTMLFORM END

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




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
Master
posted Hide Post
Normal Active Report behaviour: Upon the mouse moving off of the menu, the menu disappears.

If we can find out what code is triggered upon this event (onMouseOut?), I could perhaps call it, when my checkbox is clicked.
 
Posts: 822 | Registered: April 23, 2003Report This Post
Expert
posted Hide Post
FYI, David already has a case opened regarding this issue.

David, if you have an update/solution from the case, can you please post here? Thank you in advance for sharing with all.

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Master
posted Hide Post
this doesn't work for me as well.
I manually click somewhere on the screen to get the menu off the screen. moving mouse off the menu doesn't work..!


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report This Post
Master
posted Hide Post
quote:
David, if you have an update/solution from the case, can you please post here?

Will do.
 
Posts: 822 | Registered: April 23, 2003Report This Post
Master
posted Hide Post
Calling the JavaScript function hidemenu, upon the mouse click, will hide the pop up context menu, per my case with IB support.

-******************************************************************************
-* Focexec     : CheckProto
-* Purpose     : Checkbox Prototype - Support Checkboxes within AHTML.
-* Author      : D. Briars
-* Date Written: 07/21/11
-* Revisor     :
-* Date Revised:
-* Comments    : None.
-* Inputs      : GGPRODS - IBI Test File.
-* Output      : AHTML
-* Parms       : None.
-******************************************************************************
-** Set up environment.
-******************************************************************************
APP PREPENDPATH IBISAMP
-RUN
-******************************************************************************
-** Create AHTML w/ Checkboxes.
-******************************************************************************
DEFINE FILE GGPRODS
 CHK_BOX/A100 = '<input type="checkbox" value="CBX' || PRODUCT_ID || '"' ||
                ' onclick="RemoveMenu()"'  ||
                '>';
END
-*
TABLE FILE GGPRODS
PRINT PRODUCT_ID
      CHK_BOX AS ''
      PRODUCT_DESCRIPTION
ON TABLE HOLD AS ACTREPT FORMAT AHTML
ON TABLE SET STYLE *
     INCLUDE = nfa,
$
-* Set lines per page, and location of paging object.
 TYPE=REPORT,
-* Show all results on one page.
      LINES-PER-PAGE=UNLIMITED,
	  OBJECT=STATUS-AREA,
-* Turn off pagination bar.
	  PAGE-LOCATION=OFF,
	  JUSTIFY=CENTER,$
ENDSTYLE
END
-RUN
-******************************************************************************
-** Display AHTML Report.
-******************************************************************************
-HTMLFORM BEGIN
<html>
<head>
<title>Multi Checkboxes</title>
<script language=javascript>
//
// Function: Remove Menu
// Purpose : Removes row selected context menu, upon checkbox click.
//
function RemoveMenu() {
 var t=setTimeout("hidemenu();",5);
}
//
// Function: CheckAllCheckNone
// Purpose : Check all/Uncheck all Checkboxes, upon button click.
//
function CheckAllCheckNone(toggle) {

    var elLength = document.MyForm.elements.length;

    for (i=0; i < elLength; i++)
    {
        var type = MyForm.elements[i].type;
        var position = MyForm.elements[i].value.indexOf("CBX");
        if (type=="checkbox" && position >= 0 && (toggle)) {
            MyForm.elements[i].checked = "checked";
        }
        else if (type=="checkbox" && position >= 0 && !(toggle)) {
            MyForm.elements[i].checked = "";
        }
        else {
        }
    }
}
//
// Function: CheckCheckBoxes
// Purpose : Scroll through checkboxes, creating an array of Product Id's, for each
//           slected checkbox box.
//
function CheckCheckboxes(){
    var elLength = document.MyForm.elements.length;
    var aryCheckBoxes = new Array();
    var cntrCheckBoxes = 0

    for (i=0; i < elLength; i++)
    {
        var type = MyForm.elements[i].type;
        var position = MyForm.elements[i].value.indexOf("CBX");

        if (type=="checkbox" && MyForm.elements[i].checked && position >= 0){
            aryCheckBoxes[cntrCheckBoxes] = MyForm.elements[i].value.substr(3,4);
            cntrCheckBoxes++
        }
        else {
        }
    }

    var holdit = "Your selected Product Codes: "
    for (i=0; i < aryCheckBoxes.length; i++)
    {
      holdit = holdit + ' ' + aryCheckBoxes[i];
    }
    alert(holdit);
}
</script>
</head>
-*
<body>
<form name="MyForm">
-* Insert active report.
<table>
 <tr>
  <td> &|nbsp &|nbsp </td>
  <td> !IBI.FIL.ACTREPT; </td>
 </tr>
</table>
-* Display buttons.
&|nbsp <input value="Get Values"  type="button" onClick="CheckCheckboxes();">
&|nbsp <input value="Reset" type="reset">
&|nbsp <input value="Select All" type=button onclick="CheckAllCheckNone(true);">
&|nbsp <input value="Unselect All" type=button onclick="CheckAllCheckNone(false);">
-*
</form>
</body>
</html>
-HTMLFORM END




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
Member
posted Hide Post
I know this is an old post, but I am looking for the same thing. I do not want the context menu when the user clicks on a checkbox in the report. My initial solution was to use HTML format rather than AHTML, but the users want the active report features like sort, export, and send.

I tried the example posted, but still get the context menu.



I can hide "Comments" in the stylesheet, but none the other options will get rid of "Hightlight Value", "Hight Row", "Unhighlight All", or "Filter Cell".

TYPE=REPORT, ALLOW-COMMENTS=OFF, $ 



 
Posts: 23 | Location: Cincinnati, OH | Registered: September 25, 2013Report This Post
Master
posted Hide Post
When I run the sample code now (Release 8105M) I see the following JavaScript error:
SCRIPT5009: 'hidemenu' is undefined
File: eval code (9), Line: 1, Column: 1   

I am guessing that while the 'hidemenu' function, IB provided to me in the case, was available in my release at the time (7.x), at some point it was no longer exposed.

You might want to ask IB if there is an update to this case, or an alternative.
 
Posts: 822 | Registered: April 23, 2003Report This Post
Member
posted Hide Post
I figured it out!

The table is calling cellmenu.

<table class="arGrid" onclick="cellmenu();" onmouseout="curCell.tablenumber=-1;" bgcolor="white" id="IWindowBody0" cellpadding="0" cellspacing="0" border="0">


So I tricked it by creating a cellmenu function that does nothing and placed it at the end of the report.

-HTMLFORM BEGIN
<script>
function cellmenu() {
}
</script>
-HTMLFORM END
 
Posts: 23 | Location: Cincinnati, OH | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
Good for you! That's the currently accepted workaround.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
quote:
..So I tricked it by creating a cellmenu function that does nothing and placed it at the end of the report...

Thank you Teri.

This technique is working fine for me in 8105M.




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
  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] Active Report - How to Turn Off Context Menu Upon Click Within Report.

Copyright © 1996-2020 Information Builders