>All Tutorials 
Ajax and .NET Ajax and .NET RSS XML
Ajax and ColdFusion Ajax and ColdFusion RSS XML
Ajax and Java Ajax and Java RSS XML
Ajax and PHP Ajax and PHP RSS XML
Ajax and SOA Ajax and SOA RSS XML
Ajax Goodies Ajax Goodies RSS XML
Ajax Tool Ajax Tool RSS XML
Facebook MockAjax Facebook MockAjax RSS XML
Google Web Toolkit Google Web Toolkit RSS XML
JavaScript Framework JavaScript Framework RSS XML
Ruby on Rails Ruby on Rails RSS XML
Technique Introduction Technique Introduction RSS XML
Without XMLHttpRequest Without XMLHttpRequest RSS XML
Yahoo! UI Yahoo! UI RSS XML

Xml-script tutorial Part 2 by Alessandro Gallo - xml script type button id property attribute event

 
Registered tutorials: 501
Registered Users: 36173



Rating: 5 out of 1 votes cast


  
Category: Ajax and .NET

Xml-script tutorial Part 2 by Alessandro Gallo

Digg this   Post to del.icio.us

Abstract: In this second part shows how to declaratively handle events raised by client side controls

In the first part of this tutorial on xml-script we introduced type descriptors and learned how to read them. In this second part we'll see how to declaratively handle events raised by client side controls.

Handling events

When talking about type descriptors in the first part of the tutorial, we stated that exposing a descriptor allows instantiating client side components using xml-script. Just by looking at the type descriptor of a class, we could get an idea of how the xml-script needed to create an instance, should look. For example, the Sys.Preview.UI.Button and the Sys.Preview.UI.Label classes contained in the PreviewScript.js file expose the following descriptors:

Sys.Preview.UI.Button.descriptor = {
  properties: [ { name: 'command', type: String },
                { name: 'argument', type: String } ],
  events: [ { name: 'click' } ]
}
Sys.Preview.UI.Label.descriptor = {
  properties: [ { name: 'htmlEncode', type: Boolean },
                { name: 'text', type: String } ]
}

All the information we need to write the code in the following example is contained in the above descriptors. The code, based on the standard structure of an xml-script block of code, creates an instance of both the Button and the Label classes and wires the click event of the button with a JavaScript function that displays a message on the label.


Read Full Tutorial...



Reviews:

Rate and Review This Site

No reviews yet


Statistic Information About this Resource:


Total Hits: 6
Unique Hits: 6


  Daily Weekly Monthly
  Unique Total Unique Total Unique Total
Average 0 0 0 0 0.1 0.1
Current 0 0 0 0 0 0
Previous 0 0 0 0 0 0
Jan 23 0 0 0 0 0 0
Jan 22 0 0 0 0 0 0
Jan 21 0 0 0 0 1 1
Jan 20 0 0 0 0 0 0
Jan 19 0 0 0 0 0 0
Jan 18 0 0 0 0 0 0
Jan 17 0 0 0 0 0 0
Jan 16 0 0 0 0 0 0
Highest 1 1 1 1 2 2


Script Execution Time: 1.08792 | SQL Queries: 10 | Members: 501
Ajax Tutorial Top List - Powered by Aardvark Topsites PHP 5.1.2