Active View on HTML Page / methods

Discussion created by sovain on Oct 26, 2012
Latest reply on Nov 9, 2012 by sovain

Hi All,




Currently, I am working on a Web-version of a application using ActiveView.




AV documentation provided me with some general rules of how to insert a AV-object on a html- page.




In fact, I need to call some specific functions/events/methods of the ActiveView ActiveX component.




For example, I added to my page this code:




<object ID="Pbd1" WIDTH="351px" HEIGHT="298px"  CLASSID="CLSID:4F26B906-2854-11D1-9597-00A0C931BFC8">


<param name = "DisplayUrl" value="......../pdi/trend1.pdi"/> </object>








1. Upon initializing I get sometimes Javascript error Object is Null in the line






Null object is document.getElementById('axPbd1').Display


My question is how properly initialize AV object on HTML page using ReadyState or any other callback ?




The solution for now is I make a delay for 2 seconds before I do "AddTrace" - this is trick and incorrect. Some good solution for that is needed.




2. I do not know which VB/Javascript function to use something similar I do in C#:






trend.BeforeDoubleClick += delegate(ref bool notDoBClick, int VarX, int VarY) { notDoBClick = true; };






So I want to disable function when doubleclick on a trend in HTML page.








3. I do not know how to get to JS DOM to change something like:


               mytrendFormat.ShowTitle = true;


               mytrendFormat.ShowTagName = false;


               mytrendFormat.ShowServerName = false;


               mytrendFormat.ShowDescription = false; or to change this:


           foreach (PBSymLib.TrendElement Curel in mytrendFormat.Elements)  


                  if (Curel.Name.Equals("Pen 1")) Curel.Color = 0x00ff00u;






4. Very important(!)


How to put a XY plot on a HTML-page like I did in C#:


      SampleTrend = (XYPlot.XYPlot)SampleTrendDisplay.Symbols.Add(PBObjLib.pbSYMBOLTYPE.pbSymbolXYPlot);


      temp_Tag.SetTimeRange(false, "04/20/2011 8:31:07", "04/20/2011 22:31:07");


      temp_Tag = xydefinition.Tags.Add("sinusoid",  false);


      xydefinition.XYTitle = "Sample";


      SampletrendFormat.ShowTagName = tagname;


            SampletrendFormat.ShowServerName = servername;


            SampletrendFormat.ShowDescription = description;


            SampletrendFormat.ShowValue = value;


            SampletrendFormat.ShowEngUnits = engunits;


            SampletrendFormat.ShowTitle = plottitle;


            SampletrendFormat.DisplayScaleInside = valuescaleinsideaxis;


            SampletrendFormat.ShowGrids = grids;


            SampletrendFormat.ShowConnectingLines = connectinglines;


            SampletrendFormat.ShowCoefficient = coefficient;


            SampletrendFormat.ShowLinearCorrelation = linearcorrelation;




Any help would be very helpful.


Thank you