Re: Associating a command with a <choice> tag

Gerald Bauer <[email protected]> Wed, 24 Dec 2003 07:15:08 -0800 (PST)
Newsgroups gmane.comp.java.luxor-xul.user
Message-ID <[email protected]>
Hello Dale,

> Is this possible, if so how?
> 
> Example of what I was thinking:
> 
> <map id="license.choices">
>   <entry key="false" value="I do NOT accept the
> license agreement" />
>   <entry key="true" value="I accept the license
> agreement" />
> </map>
> ...
> <choice id="license.choice" map="license.choices"
> type="radio"
> command="enable.license.next" />
> ...
> <button label="Prev &lt;" id="license.prev"
> command="welcome.show"
> accesskey="P" key="p" />
> <button label="Next &gt;" id="license.next"
> command="chooselocation.show"
> accesskey="N" key="n" />

  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.

  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.  

  - Gerald


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