Comunidad de diseño web y desarrollo en internet online

Prototype,acceder a una var dela superclase desd su subclase

Citar            
MensajeEscrito el 29 Nov 2007 09:17 pm
Usando prototype estoy creando una clase llamada Object (que de hecho es una subclase de otra clase llamada viewForms) con una subclase dentro llamada (Form).

Quiero acceder DESDE la subclase Form a la propiedad objectName de su clase padre Object.

este es el codigo, alguna idea?

Código :

Object: Class.create(viewForms,{
   initialize: function(objectName,url,method){
      ioDebug.info("<b>viewForms.object</b> creado con: <br><b>objectName:</b>"+objectName+
         "<br><b>url:</b>"+url+"<br><b>method:</b>"+method,"viewForm.object");
      this.objectName = objectName;
      this.url = url;
      this.method = method;
      this.active = 0;
   },
   object: null,
   url: null,
   method: null,
   
   //Formularios actuales de este objeto
   forms: [],
   
   /**
    * Form
    * Metodos:
    *    iframe
    *    ajax
    *    modal
    * 
    * @param {Object} id
   */ 
   Form: Class.create(viewForms.Object,{
      initialize: function($super,id){
         ioDebug.info("<b>viewForms.object</b> creado con: <br><b>object:</b>"+this.objectName+
         "<br><b>id:</b>"+id,"viewForms.Object.Form");
         this.options = {
            method: 'iFrame',
         };
      },
   })
   
   })

Por neohunter

Claber

563 de clabLevel

1 tutorial

 

Bogota, Colombia

opera
Citar            
MensajeEscrito el 29 Nov 2007 09:22 pm
en la documentacion de prototype,

http://www.prototypejs.org/api/class/create

dice:

Special properties

Classes themselves contain several special properties:
The superclass property refers to an class's superclass (or null if there is no superclass).

como accedo a esa propiedad?

Código :

superclass.objectName


me da error

Por neohunter

Claber

563 de clabLevel

1 tutorial

 

Bogota, Colombia

opera
Citar            
MensajeEscrito el 29 Nov 2007 09:24 pm
esto tambien da error

Código :

this.superclass.objectName 
this.Object.objectName

Object es el nombre de la superclase... alguna idea?

Por neohunter

Claber

563 de clabLevel

1 tutorial

 

Bogota, Colombia

opera
Citar            
MensajeEscrito el 29 Nov 2007 09:33 pm

Por neohunter

Claber

563 de clabLevel

1 tutorial

 

Bogota, Colombia

opera

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.