Solved

Problem when hiding Objects

Posted on 2001-09-13
9
204 Views
Last Modified: 2007-12-19
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
Comment
Question by:mor4eus
  • 6
  • 3
9 Comments
 
LVL 2

Expert Comment

by:rabanero
ID: 6481693
Hi, again!

Please, can you write your final code to test it?
0
 
LVL 1

Author Comment

by:mor4eus
ID: 6481705
---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
 
LVL 1

Author Comment

by:mor4eus
ID: 6481712
You can test on.

http://203.37.28.90/menu
0
 
LVL 2

Expert Comment

by:rabanero
ID: 6481733
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Comment

by:mor4eus
ID: 6481737
You can test on.

http://203.37.28.90/menu
0
 
LVL 1

Author Comment

by:mor4eus
ID: 6481755
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
 
LVL 2

Accepted Solution

by:
rabanero earned 50 total points
ID: 6481780
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
 
LVL 1

Author Comment

by:mor4eus
ID: 6481910
Still lose it all.  Maybe it is a problem with the object.
Is there a way to simulate a mouse click??
0
 
LVL 1

Author Comment

by:mor4eus
ID: 7009816
Thanks for the help, even though I didn't fix the prob, thanks anyway.  Just clearing all my outstanding q's.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now