Home arrow XML arrow Widget Walkthrough
XML

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: 3 stars3 stars3 stars3 stars3 stars / 2
August 21, 2006
TABLE OF CONTENTS:
  1. · Widget Walkthrough
  2. · Getting the headlines
  3. · Using loops
  4. · Fine tuning headline retrieval
  5. · Publishing your widget

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
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">
<![CDATA[
    function updatepreferences() {
      datatextarea.font = preferences.textfontpref.value;
      datatextarea.color = preferences.textcolorpref.value;
      datatextarea.size = preferences.textsizepref.value;
      datatextarea.style = preferences.textstylepref.value;
    }
    updatepreferences();
]]>
</action>
<action trigger ="onPreferencesChanged">
    updatepreferences();
</action>

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
XML ARTICLES

- 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
- Simple Web Syndication with RSS 2.0
- Java UI Design with an IDE

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



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