Design Review

Design Review

Reply
Member
kkcnkc
Posts: 3
Registered: ‎11-05-2011
Message 1 of 6 (1,435 Views)
Accepted Solution

Can not access ADViewer object in JavaScript

1435 Views, 5 Replies
11-17-2011 09:03 AM
Hi All,

I am try use your below code in JavaScript but it does't work.

I am refer Autodesk Design Review 2012 API Reference
I am try to Execute code in "Embedding a DWF File in a Web Page" this topic.
but not able to
execute, some thing is missing and i am not able to find what is missing or
what is wrong. Help
me.

Please try to execute my Code.

[code]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<script language="javascript" type="text/javascript">
function getElements()
  {
          var ADViewer = document.getElementById("ADViewer"); // 2nd Way
        alert(ADViewer);
        var ECompViewer = ADViewer.ECompositeViewer;     // 1st Way
        alert(ECompViewer);
        var Sections = ECompViewer.Sections;
        var secList = document.getElementById("SectionList");
        for (iSection = 1;(iSection <= Sections.Count); iSection++)
        {
                var Section = Sections(iSection); //Set the section to a
separate object
                alert(Section.Title);
                secList.innerHTML += Section.Title + "<BR>";
        }
  }
</script>
</head>
<body>


<input type="text" size="20" /><br />
<input type="text" size="20" /><br /><br />
<input id="abc" type="button" onClick="getElements()" value="How many input
elements?" />
        <object id="ADViewer" type="application/x-Autodesk-DWF" width="400"
height="400"

                        data="application/DWF085825-1-zobell_residence.dwf">
                <param name="Src"
value="http://50.57.86.168:8181/cat/DwfFile/DWF085825-1-zobell_residence.dwf
" />
        </object>

</body>
</html>

[/code]

In my PC this code execute in Google Crome but below issue.
Please try this code to execute.
In my Code there are 3 alert boxes.
  In 1 alert box shows [object HTMLObjectElement]
  In 2 alert box shows undefined
  3 rd alert box not executed.

Another thing is that this JavaScript code only run in Google Crome. not in
IE 8.0 or FireFox  3.6.12

When i am using [ classid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" ]
this code it will not
execute in Google Crome not IE 8.0 not in FireFox 3.6.12 also not loaded DWF
Viewer in browser.

My PC Configuration is :
      Windows 7 Ultimate
      1 GB RAM
      64-bit OS
      Autodesk Design Review Browser Add-on for NPAPI browser v 1.2
      Autodesk Design Review 2012 Software v 12.0.0.98 installed in PC.

Reply as early as possible.


Thank you.
Employee
herbert.he
Posts: 338
Registered: ‎03-05-2008
Message 2 of 6 (1,431 Views)

Re: Can not access ADViewer object in JavaScript

11-17-2011 06:17 PM in reply to: kkcnkc

Thank you for your question.

 

To insure your script works in both IE and Chrome/Firefox, please refer to this port for solution.

    http://forums.autodesk.com/t5/Autodesk-Design-Review/DWF-won-t-load-in-Firefox-nor-Chrome-but-will-i...

 

Please let me know if I can be of any further assistance.



Herbert He
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Contributor
usheokand
Posts: 14
Registered: ‎03-05-2012
Message 3 of 6 (1,243 Views)

Re: Can not access ADViewer object in JavaScript

03-15-2012 10:51 PM in reply to: herbert.he

Hi,

 

I went through the links, but this only helps displaying the dwf file in mozilla/chrome, there is no way described to access the ADR control and access its controls programmatically. Please help over it.

 

Thanks.

Member
kkcnkc
Posts: 3
Registered: ‎11-05-2011
Message 4 of 6 (1,232 Views)

Re: Can not access ADViewer object in JavaScript

03-16-2012 02:11 AM in reply to: usheokand

Hi

usheokand

 

I solve my problem and also access ADViewer and with some my related funcationality.

 

What you want? Please elobrate your problem. So i can help you.

 

Thanks,

Kkcnkc

 
Contributor
usheokand
Posts: 14
Registered: ‎03-05-2012
Message 5 of 6 (1,230 Views)

Re: Can not access ADViewer object in JavaScript

03-16-2012 02:18 AM in reply to: kkcnkc

Hello kkcnkc,

 

thanks for replying back.

 

I will explain my situation here.

I want to display dwf files in web browser.

So I followed the API provided for ADR and embeded the control.

The display work is fine.

I want to hide some of the commands, in IE am able to hide/show the command buttons over toolbar.

But in non IE browser such as Mozilla & Chrome, I cannot access the commands.

The IE version of accessing EComposisteViewer does not work with Mozilla.

So I was wondering did you try to acess the command or any other child control of the ADR?

 

Thanks Again.

 

New Member
vkathir
Posts: 2
Registered: ‎09-12-2013
Message 6 of 6 (626 Views)

Re: Can not access ADViewer object in JavaScript

09-12-2013 04:04 PM in reply to: usheokand

I am also facing the same problem.

I could not access the EComposisteViewer object in FireFox or Chrome, but works fine in IE.

Did you find the solution for your problem ?

 

Thanks,

vkathir.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.