RE: Associating a command with a <choice> tag

"R. Dale Asberry" <[email protected]> Wed, 24 Dec 2003 10:49:08 -0500
Newsgroups gmane.comp.java.luxor-xul.user
Message-ID <[email protected]>
>   As far as I can tell you can't use the command
> attribute directly for comboboxes. You need to get a
> handle on the Swing combobox and add your eventhandler
> the "old fashioned" way. To get a handle on the Swing
> combobox you have two options.
>
>   1) You can either lookup the combobox using the
> Swing component name/id using, for example, the
> CompUtils.get( Container parent, String id ) method
> shipping with the Salsa package.

Is there documentation for these other packages (Salsa, Cypress, Caramel, et
al)?  I didn't know about this particular utility and it could be handy to
have a reference to them.

>
>   2) You can use a XulForm and bind the comboxbox to a
> XulInput object and than use getJComponent().
>
>   Option 1 is the way forward and recommended.

I think I'm going to write custom tags

<radiogroup ...>
  <radio ... />
  ...
</radiogroup>

because it seems more obvious and will allow me to extend it to use the
"command" attribute.  Not that it matters, but I like the idea of
consistency between XUL dialects (Mozilla) too.  I can donate this work back
to the project, if you're interested.  One other thing that I like about
Mozilla XUL is the "observes" attribute although I'm not sure how I would
specify a programmatic listener.

My particular use-case is to enable the "Next >" button when the user
chooses the "I Accept the License Agreement" radio button - "observes" would
be very handy.

Ultimately, I need to "tie" my generic actions to XulActions and back to the
Xul components.  Option 1 looks like the best way as you suggest... I've
been struggling with how to do that.



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click