Hi, I'm trying to assign a custom object that I defined to a node, and then retrieve it.
Here is the code of the custom object:
Quote:function Datos(codigo, fechaCreacion, nombre, puestoResponsable, descripcion) {
this.codigo = codigo;
this.fechaCreacion = fechaCreacion;
this.nombre = nombre;
this.puestoResponsable = puestoResponsable;
this.descripcion = descripcion;
}
function DatosProceso(codigo, fechaCreacion, nombre, puestoResponsable, descripcion, estadoDeDisen) {
this.base = new Datos(codigo, fechaCreacion, nombre, puestoResponsable, descripcion);
this.estadoDeDisen = estadoDeDisen;
}
I create a new object and assign it to a node using "setTag()":
Quote:var applet = <%= DiagramView.AppletElement %>;
nuevoProceso = new DatosProceso("", DateEditProceso.GetDate(), txtNombreProceso.GetText(), "", txtDescripcionProceso.GetText(), "");
applet.getDiagram().getActiveItem().setTag(nuevoProceso);
And then I try to retrieve it using "getTag()" and calling "alert" to show the "nombre" property:
Quote:var applet = <%= DiagramView.AppletElement %>;
tag = applet.getDiagram().getActiveItem().getTag();
alert(tag.base.nombre);
but the browser doesn't show nothing.
When I check the type of "tag" using "typeof(tag)" it says that is a string, so I don't know if I have to do a casting or something else.
Thanks,
Juan