Wednesday, March 21, 2012

Atlas script reference

Hi,

I'm new in Atlas world, so this may be a dumb question: I can't find a reference to the Atlas script library! Where should I look?

Thanks for your help...

hello.

what do you mean?


Sorry about the vague message. Let me give you an example. I found the following XML script in a great blog posting by Garbin, on AspAdvice:

<

scripttype="text/xml-script">

<page>

<components>

<control id=...>

<behaviors>

<dragDropList dataType=

"HTML" ...

...

OK. This is great. But how do I know that there is a "Page" element, under that a "Components" element, then a possible child is "Control" and "Behaviors" is a child of that, and so on and so forth. For instance how do I find the other possible children for the "behaviors" element? Intellisence does not work and I can't find a reference.

Thanks,

-K


hello again.

ah, now I understand what you're after.

well, lets start with the top element, page. currently, and if i recall correctly, this is just a convention name. you can change it if you want, and i think you'll still get the same results because the platform doesn't make any checks on the top element you use.

regarding the other elements, well, as you've noticed, the most commonly used child element is the component element. this is where you'll put most of your declarations. currently, you can take a look at the online help to get an idea of how to use several elements:

http://atlas.asp.net/docs/Client/default.aspx

you can also take a peek at the atlas code files to see which classes are used. tipically, all the the classes that can be used from xml-script register themselves with the Sys.TypeDescriptor class. for instance, the application class registers itself with the following code:

Sys.TypeDescriptor.addType('script', 'application', Sys._Application);

this means that the <application> element found on the xml-script block should be handled by the Sys._Application class. After seeing if a class can be used from xml-script, you can see which members you can use from that language by looking for the getDescriptor method. again, if you look at the application class, you have this:

this.getDescriptor = function() {
var td = new Sys.TypeDescriptor();

td.addEvent('load', true);
td.addEvent('unload', true);

return td;
}

in this case, you can handle 2 events (load and unload) from the xml-script code.

well, i think that this is enough to get you started.


I see. So there is no documentation or reference and I have to dissect the code to find my way around the framework. I must admit that it's fun, but by no means what I consider an efficient way to program. Thanks for your help though.


hello again.

well, the link i've sent you in the previous post shows several elements and their xml syntax. what i said is that probably the list doesn't have all elements yet and due to that you might have to go through the code.


That's very helpful. Thanks.

No comments:

Post a Comment