Home arrow XML arrow Page 3 - An Introduction to XUL Part 2

Changing Textbox Attributes - XML

Learn about XUL, a subset of XML used to describe user interfaces, that helps you to make rich user interfaces with nothing more complicated than a text editor. In the second part of this series, Dan Wellman covers implementing more kinds of buttons. He also begins talking about creating Menu Bars, Tooltips, and Status Bars.

  1. An Introduction to XUL Part 2
  2. Organizing Buttons
  3. Changing Textbox Attributes
  4. Menu Bar and Interface
  5. Cleaning Up and Adding a Status Bar
  6. Using ToolTips and Progress Bars
By: Dan Wellman
Rating: starstarstarstarstar / 10
May 30, 2005

print this article



Note here that if you add a value attribute to the text box, this will display, but if a user clicks on it to add some text of their own, their text will be appended to the end of the string you set the value to rather than replacing it.  Without JavaScript to do something with the input it won’t do much anyway, but it’s worth bearing in mind for now.  Like HTML input boxes, XUL text boxes can also be one of several types of text boxes; password, autocomplete, or unusually, timed.  So adding the following code would add a text field that displayed stars when input was entered:

<textbox id="pass" type="password"/>

The syntax for the other types is very similar.

Looking at your window, the various controls may seem a little random; we know what the controls are for because of the labels, but if the labels contained the values of the radio buttons for example, you would need some kind of heading or title to show the user what they were for.  Simple lines of text can be added to the window using either the <description value= ”yourtexthere”>, or the <caption label= ”yourtexthere”/> syntax.  The main difference between these is that captions are automatically indented slightly.  Additionally, you can specify a control label that is tied to the control using the id attribute of the control and the control attribute of the label:

<label control="gender" value="Please select your gender"/>
  <radiogroup id="gender">
    <radio label="Male" selected="true"/>
    <radio label="Female"/>

Execute the file and see how it looks.

>>> More XML Articles          >>> More By Dan Wellman

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Google Docs and Xpath Data Functions
- Flex Array Collection Sort and Filtering
- The Flex Tree Control
- Flex List Controls
- Working with Flex and Datagrids
- How to Set Up Podcasting and Vodcasting
- Creating an RSS Reader Application
- Building an RSS File
- An Introduction to XUL Part 6
- An Introduction to XUL Part 5
- An Introduction to XUL Part 4
- An Introduction to XUL Part 3
- An Introduction to XUL Part 2
- An Introduction to XUL Part 1
- XML Matters: Practical XML Data Design and M...

Developer Shed Affiliates


Dev Shed Tutorial Topics: