Bugs item #544180, was opened at 2002-04-15 14:08
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105757&aid=544180&group_id=5757

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: David Scanlan (dscanlan)
Assigned to: Nobody/Anonymous (nobody)
Summary: Dynlayer.js elm error, NS4 + IE5, R2.56

Initial Comment:
When I attempt to use DynAPI.document.addChild to add a layer, I get 'elm' errors in 
both 
NetScape (4.76) and IE5

NetScape error dynlayer.js line 103  elm has no properties.
IE error line 91 'elm.style' is null or not an object

Basically, I have two parts to this, which are both generated by the same code. The 
'StdLayer' 
code completes OK, the 'StdEditLayer' code completes with the error. As soon as I do 
anything 
after this in NS, the application crashes out. I'm running release 2.56.

I can't see what I have done to get this situation. Any pointers you could give me 
would be much 
appreciated. I have to admit that this was working, but I can't find out what I have 
done to stop it 
from working.... :-(

PS. The application displays a tabbed page, where the users can click on the tabs to 
display 
different information. Everything works fine for the read-only displays, but the 
editable information 
fails.

  StdLayer = new DynLayer( null,0,0,PageWidth,PageHeight,null,false,10 );
  StdTFLayer = new TableFrame( TableFromX,TableFromY,TableWidth,TableHeight, 
StdHTMLNoEdit 
);
  StdLayer.addChild( StdTFLayer );
  var TabX = (TableWidth/10) + TableFromX;
  StdLayerTab1 = new Tab( TabX , TableFromY , 100 , TableWidth/8 , null , 'Standard', 
'' );
  StdLayer.addChild( StdLayerTab1 );
  TabX = TabX + TableWidth/7.5;
  StdLayerTab2 = new Tab( TabX , TableFromY , 98, TableWidth/8 , null , 'People 
Tracker' , 
'DisplayLayer("PTrack");' );
  StdLayer.addChild( StdLayerTab2 );
  TabX = TabX + TableWidth/7.5;
  StdLayerTab3 = new Tab( TabX , TableFromY , 97, TableWidth/8 , null , 'Absences' , 
'DisplayLayer("Absences");' );
  StdLayer.addChild( StdLayerTab3 );
  TabX = TabX + TableWidth/7.5;

  var Test1 = "Std\n";
  for (prop in StdLayer) Test1 += 'name: ' + prop + "\t";
  DynAPI.document.addChild( StdLayer );

  StdEditLayer = new DynLayer( null,0,0,PageWidth,PageHeight,null,false,10 );
  StdTFELayer = new TableFrame( 
TableFromX,TableFromY,TableWidth,TableHeight,StdHTMLEdit );
  StdEditLayer.addChild( StdTFELayer );
  var TabX = (TableWidth/10) + TableFromX;
  StdEditLayerTab1 = new Tab( TabX , TableFromY , 100 , TableWidth/8 , null , 
'Standard', '' );
  StdEditLayer.addChild( StdEditLayerTab1 );
  TabX = TabX + TableWidth/7.5;
  StdEditLayerTab2 = new Tab( TabX , TableFromY , 98, TableWidth/8 , null , 'People 
Tracker' , 
'DisplayLayer("PTrack");' );
  StdEditLayer.addChild( StdEditLayerTab2 );
  TabX = TabX + TableWidth/7.5;
  StdEditLayerTab3 = new Tab( TabX , TableFromY , 97, TableWidth/8 , null , 'Absences' 
, 
'DisplayLayer("Absences");' );
  StdEditLayer.addChild( StdEditLayerTab3 );
  TabX = TabX + TableWidth/7.5;

  Test1 += "\n\nStdEdit (Final)\n";
  for (prop in StdEditLayer) Test1 += 'name: ' + prop + "\t";
  alert( Test1 );

  DynAPI.document.addChild( StdEditLayer );    // **** This is where the error occurs 
****
  alert( 'Child layers added to StdEditLayer');


                                    **************************************

TableFrame & Tab definitions....

//
// Now we include the constructors for the TabulatedForm and Tabs
//

function Tab(x,y,z,w,h,contents,execFunc) {
  this.h = h || ButtonHeight;
  this.w = w || 80;
  this.z = z || 1;
  this.dynlayer=DynLayer;
  this.dynlayer(null,x,y,this.w,this.h,null,true,this.z);
  this.contents = contents || '';
  this.execFunc = execFunc|| '';
  this.addEventListener(Tab.listener);
  return this
}
Tab.prototype=new DynLayer();
Tab.listener=new EventListener();
Tab.listener.onprecreate=function(e) {
  var o=e.getSource();

  // Specify the button or Layer to be displayed...
  if(o.execFunc=='') {
    // No functionality should be included here.
    o.button = new DynLayer(null,7,7,o.w-14,o.h-14,'#C2C2C2',true,null,null,'<TABLE 
BORDER=0 
CELLPADDING=0 CELLSPACING=0><TR><TD NOWRAP WIDTH=' + (o.w-14).toString() + ' 
Class=SelectTab' + NoEditBaseFontSize + '>' + o.contents + '</TD></TR></TABLE>');
  }
  else {
    // We need to execute this function, so therefore include a button
    o.button = new DynLayer(null,7,7,o.w-14,o.h-14,'#C2C2C2',true,null,null,'<TABLE 
BORDER=0 
CELLPADDING=0 CELLSPACING=0><TR><TD NOWRAP WIDTH=' + (o.w-14).toString() + ' 
Class=Tab' 
+ NoEditBaseFontSize + '>' + o.contents + '</TD></TR></TABLE>');
    Listener=new EventListener(o.button);
    Listener.onmouseover=function(e) {
      target=e.getTarget();
      target.setBgColor('#D8D8D8');
    }
    Listener.onmouseout=function(e) {
      target=e.getTarget();
      target.setBgColor('#C2C2C2');
    }
    Listener.onmouseup = function(e) {
      if(DebugFlag) alert('Executing ' + o.execFunc );
      eval(o.execFunc);
    }

    o.button.addEventListener(Listener);
  }
  o.addChild(o.button);

  // Build the border around the tab
  o.addChild(new 
DynLayer(null,0,0,null,null,null,true,2,null,BuildIMG(BorderTopLeft)));
  o.addChild(new 
DynLayer(null,o.button.getWidth()+7,0,null,null,null,true,2,null,BuildIMG(BorderTopRight)));
  o.addChild(new 
DynLayer(null,0,o.getHeight(),null,null,null,true,2,null,BuildIMG(BorderBottomLeft)));
  o.addChild(new 
DynLayer(null,o.button.getWidth()+7,o.getHeight(),null,null,null,true,2,null,BuildIMG(BorderBottomRi
ght)));

  o.addChild(new 
DynLayer(null,7,0,o.button.getWidth(),null,null,true,2,null,BuildIMG(BorderTop,'WIDTH='+(o.button.g
etWidth())+' HEIGHT=7')));
  o.addChild(new 
DynLayer(null,0,7,7,o.getHeight()-14,null,true,2,null,BuildIMG(BorderLeft,'HEIGHT='+(o.getHeight()-
14)+' WIDTH=7')));
  o.addChild(new 
DynLayer(null,o.button.getWidth()+7,7,7,o.getHeight()-14,null,true,2,null,BuildIMG(BorderRight,'HEI
GHT='+(o.getHeight()-14)+' WIDTH=7')));

}

function TableFrame(x,y,w,h,contents,tabHeight) {
  var TFHeight = tabHeight || ButtonHeight;
  this.dynlayer=DynLayer;
  this.dynlayer(null,x,y,w+14,h+14+TFHeight,null,true,20);
  this.contents = contents || '';
  this.tabHeight = TFHeight;
  this.addEventListener(TableFrame.listener);
  return this
}

TableFrame.prototype=new DynLayer();

TableFrame.listener=new EventListener();
TableFrame.listener.onprecreate=function(e) {
  var o=e.getSource();

  // Build the border around the table - The Corners
  o.addChild(new 
DynLayer(null,0,o.tabHeight-7,7,7,null,true,5,null,BuildIMG(BorderTopLeft)));
  o.addChild(new 
DynLayer(null,TableWidth+7,o.tabHeight-7,null,null,null,true,5,null,BuildIMG(BorderTopRight)));
  o.addChild(new 
DynLayer(null,0,TableHeight+o.tabHeight,null,null,null,true,5,null,BuildIMG(BorderBottomLeft)));
  o.addChild(new 
DynLayer(null,TableWidth+7,TableHeight+o.tabHeight,null,null,null,true,5,null,BuildIMG(BorderBottom
Right)));

  // Top and Bottom
  o.addChild(new 
DynLayer(null,7,o.tabHeight-7,null,null,null,true,5,null,BuildIMG(BorderTop,'WIDTH='+(TableWidth)+'
 
HEIGHT=7')));
  o.addChild(new 
DynLayer(null,7,TableHeight+o.tabHeight,null,null,null,true,5,null,BuildIMG(BorderBottom,'WIDTH='+(
TableWidth)+' HEIGHT=7')));

  // Left and Right
  o.addChild(new 
DynLayer(null,0,o.tabHeight,7,TableHeight,null,true,5,null,BuildIMG(BorderLeft,'HEIGHT='+(TableHeig
ht)+' WIDTH=7')));
  o.addChild(new 
DynLayer(null,TableWidth+7,o.tabHeight,7,TableHeight,null,true,5,null,BuildIMG(BorderRight,'HEIGHT
='+(TableHeight)+' WIDTH=7')));

  // Include the table
  o.addChild(new 
DynLayer(null,7,o.tabHeight,null,null,null,true,null,null,o.contents));
}


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105757&aid=544180&group_id=5757

_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/dynapi-dev@lists.sourceforge.net/

Reply via email to