Home arrow XML arrow Widget Walkthrough

Widget Walkthrough

The first half of this tutorial introduced you to making a rudimentary but functional widget of the sort you can find on Yahoo's site since its purchase of Konfabulator. In this article, you'll add the finishing touches to increase its functionality.

Author Info:
By: Dan Wellman
Rating: 4 stars4 stars4 stars4 stars4 stars / 6
August 21, 2006
  1. · Widget Walkthrough
  2. · Getting the headlines
  3. · Using loops
  4. · Fine tuning headline retrieval
  5. · Publishing your widget

print this article

Widget Walkthrough
(Page 1 of 5 )

Widget Walkthrough 

The preferences that you created in the first part of this article won't actually do anything on their own; they'll need the following JavaScript in order to actually make the required changes:

<action trigger="onLoad">
    function updatepreferences() {
      datatextarea.font = preferences.textfontpref.value;
      datatextarea.color = preferences.textcolorpref.value;
      datatextarea.size = preferences.textsizepref.value;
      datatextarea.style = preferences.textstylepref.value;
<action trigger ="onPreferencesChanged">

As you can see, each action (onLoad and onPreferencesChanged) is contained within its own <action> element.  All each line of the updatepreferences() function is doing is setting the attributes of the textarea element, much as CSS would with HTML.  I've included the opening CDATA tag as we'll need it for one of the next functions.

blog comments powered by Disqus

- Open XML Finally Supported by MS Office
- XML Features Added to Two Systems
- Using Regions with XSL Formatting Objects
- Using XSL Formatting Objects
- More Schematron Features
- Schematron Patterns and Validation
- Using Schematron
- Datatypes and More in RELAX NG
- Providing Options in RELAX NG
- An Introduction to RELAX NG
- Path, Predicates, and XQuery
- Using Predicates with XQuery
- Navigating Input Documents Using Paths
- XML Basics
- Introduction to XPath

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials