portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sean Taylor <d.tay...@onehippo.com>
Subject Re: JSON + Ajax + toolbox
Date Thu, 19 Nov 2009 22:01:55 GMT


On Nov 19, 2009, at 8:36 AM, Gonzalo Aguilar Delgado wrote:

> Hi  David,
>
> I've already done the interface. I got results and everything is
> working.
>
> The problem as you say is about working with xml... It's a pain. I  
> can't
> make it work
> with xml.

Regarding XML, here is an example Im working on for move absolute  
action:

   var onMoveComplete = function(id, o, args) {
     	var id = id; // Transaction ID.
     	var data = o.responseText; // Response data.
     	Y.log("move result = " + data);
     	var dataIn = Y.DataType.XML.parse(data),    	 	
     	schema = {
     		metaFields: {status:"//status", action:"//action", reason:"// 
reason", id:"//id",
     	      oldcol: "//old_position/col", oldrow: "//old_position/row",
     	      newcol: "//new_position/col", newrow: "//new_position/row"}
     	 },
     	dataOut = Y.DataSchema.XML.apply(schema, dataIn);
	Y.log("status = " + dataOut.meta.status);
	Y.log("action = " + dataOut.meta.action);
	Y.log("reason = " + dataOut.meta.reason);
	Y.log("id = " + dataOut.meta.id);
	Y.log("oldcol = " + dataOut.meta.oldcol);
	Y.log("oldrow = " + dataOut.meta.oldrow);
	Y.log("newcol = " + dataOut.meta.newcol);
	Y.log("newcol = " + dataOut.meta.newrow);

	var widgetId = args[0];
     };



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message