• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

Problem when hiding Objects

I have an object, Crystal Reports ActiveX Viewer which I hide with a mouseover.  The problem is if I don't click on the screen, anywhere except on the object, before I hide the object then when it reappears, the object no longer works anymore.  But if i click on the page somewhere outside the object it seems fine to be hidden/unhidden any ammount of times. Any help??
0
mor4eus
Asked:
mor4eus
  • 6
  • 3
1 Solution
 
rabaneroCommented:
Hi, again!

Please, can you write your final code to test it?
0
 
mor4eusAuthor Commented:
---index.cfm---

<frameset rows="55,*" border="0">
<frame src="topfr.cfm?PageTitle=Test Page" name="topFr" scrolling="No"></frame>
<frame name="content" src="report.cfm"></frame>
</frameset>

---report.cfm----

<html>
<head>
<TITLE>Crystal Report Viewer</TITLE>
<link rel="stylesheet" href="style.css"></link>
<script language="JavaScript1.2" src="subfr.js"></script>
<script type="text/javascript" src="james.js"></script>

<script type="text/javascript" language="JavaScript">
<!--
function setVisible(elem, flag)
{
elem.style.visibility = flag ? '' : 'hidden';
}
-->
</script>
</head>

<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript topmargin=0 leftmargin=0>

<object classid="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
codebase="/viewer/activeXViewer/activexviewer.cab#Version=8,5,0,217"
width="100%" height="98%" id="CRViewer">

<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=0>
<PARAM NAME="EnableGroupTree" VALUE=0>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=0>
<PARAM NAME="EnableZoomControl" VALUE=0>
<PARAM NAME="EnableSearchExpertButton" VALUE=0>
<PARAM NAME="EnableSelectExpertButton" VALUE=0>
</object>


<SCRIPT LANGUAGE="VBScript">
<!--

Sub window_onLoad()
      Page_Initialize()
End Sub

Sub Page_Initialize
    On Error Resume Next
    Dim webBroker
    Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
    if err.number <> 0 then
        window.alert "The Crystal ActiveX Viewer is unable to create it's resource objects."
        CRViewer.ReportName = "/menu/jf.rpt"
    else
        Dim webSource0
            Set webSource0 = CreateObject("WebReportSource.WebReportSource")
            webSource0.ReportSource = webBroker
            webSource0.URL = "/menu/jf.rpt"
            webSource0.PromptOnRefresh = True
            
            CRViewer.ReportSource = webSource0
    end if
    CRViewer.ViewReport
End Sub

-->
</SCRIPT>
<OBJECT ID="ReportSource"
      CLASSID="CLSID:F2CA2115-C8D2-11D1-BEBD-00A0C95A6A5C"
      HEIGHT=1% WIDTH=1%
    CODEBASE="/viewer/activeXViewer/activexviewer.cab#Version=8,5,0,217">
</OBJECT>
<OBJECT ID="ViewHelp"
      CLASSID="CLSID:BD10A9C1-07CC-11D2-BEFF-00A0C95A6A5C"
      HEIGHT=1% WIDTH=1%
    CODEBASE="/viewer/activeXViewer/activexviewer.cab#Version=8,5,0,217">
</OBJECT>
<OBJECT ID="ReportParameter"
      CLASSID="CLSID:71C140F3-1A84-430b-9035-68815582DC79"
      HEIGHT=1% WIDTH=1%
    CODEBASE="/viewer/activeXViewer/reportparameterdialog.cab#Version=8,0,2,672">
</OBJECT>
<div>
<!-- this empty div prevents IE from showing a bunch of empty space for the controls above.. I don't know why though. -->
</div>
</body>
</html>
 

----topfr.cfm-----

<html>

<head>
<link rel="stylesheet" href="style.css"></link>
<script language="JavaScript1.2" src="subfr.js"></script>
<script type="text/javascript" language="JavaScript">
<!--
function setVisible(elem, flag)
{
elem.style.visibility = flag ? '' : 'hidden';
}
-->
</script>
</head>

<body style="background: #000000; color: white; margin: 0">

<table height="34" width="100%" border="1" cellspacing="0" cellpadding="0" bgcolor="#FEC400">
<td width="35" rowspan="2" align="center" valign="middle"><a href="http://sydback/newintranet/index.cfm"><img src="./images/fmrlogo.gif"  width="30" height="26" border="0"></a></td>
<td rowspan="2" valign="middle"><font face="Arial" size=5 color="#000000"><b><cfoutput>#pagetitle#</cfoutput></b></font>
<input type="button" onclick="setVisible(parent.content.document.all['CRViewer'], true)" value="Show">
<input type="button" onclick="setVisible(parent.content.document.all['CRViewer'], false)" value="Hide"></td>
<td align="right" valign="bottom"><font face="Arial" size=1 color="#000000"></font></td></tr>
<tr><td align="right"><font face="Arial" size=1 color="#000000"><a href="index.cfm">Logon</a></font></td></tr>
</table>

</body>
</html>
0
 
mor4eusAuthor Commented:
You can test on.

http://203.37.28.90/menu
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
rabaneroCommented:
Sorry, the ActiveX doesn't work on my browser (I have IE4 on Windows NT without administrator profile). The object seems to load well, and there is no flickering. I have tested when your pull down the menus, the object hides automatically. Is this a problem?.

And ActiveX doesn't hides with a mouseover, or I am wrong?
0
 
mor4eusAuthor Commented:
You can test on.

http://203.37.28.90/menu
0
 
mor4eusAuthor Commented:
Yeah I made a few changes.  I works as wanted.  I just restarted it aswell.  But when you do a mousover or click on hide, without clicking anywhere else on the page the activex goes all funny.  But if you click on a blank part on the top frame then hide, it all works well.  You will notice all the buttons go missing on the object.
0
 
rabaneroCommented:
Well, perhaps you need not to hide visibility (it is detecting all click because it has active region hidden). Try to set "display" property no "none". Difference is "display" not hides the object, deletes temporally the object representation (and disables events in it).

To try this, replace setVisible function in all cases with this:

function setVisible(elem, flag)
{
elem.style.display= flag ? '' : 'none';
}
0
 
mor4eusAuthor Commented:
Still lose it all.  Maybe it is a problem with the object.
Is there a way to simulate a mouse click??
0
 
mor4eusAuthor Commented:
Thanks for the help, even though I didn't fix the prob, thanks anyway.  Just clearing all my outstanding q's.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now