You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Michael Bushe <mi...@bushe.com> on 2010/02/23 01:22:37 UTC

WTKX Key Listener and Schema

I'm trying to add a keyListener in WTKX.  I gave this a shot:
                   <keyListeners>
                       <wtkx:script>
                           function keyTyped(component, keyCode) {
                               if (keyCode == Keyboard.KeyCode.ENTER) {
                                      callMyFunction();
                               }
                           }
                       </wtkx:script>
                   </keyListeners>

OK, giving me a fish and telling me how to do is nice, but I want the rod.
Where can I find the Schema or DTD?  Is there a link on the site?  I
couldn't find it.

I tried to search the mailing list too, but the mailing list link doesn't
have a
search:
http://mail-archives.apache.org/mod_mbox/pivot-user/ (and clicking a link
there):
http://mail-archives.apache.org/mod_mbox/pivot-user/201002.mbox/browser

Michael Bushe
Principal
Bushe Enterprises, Inc.
michael@bushe.com
www.bushe.com

Re: WTKX Key Listener and Schema

Posted by Greg Brown <gk...@mac.com>.
Basically, everything in WTKX maps directly to a Java equivalent. so, while there's no DTD, the WTKX/Java relationship is very straightforward. It is discussed in the WTKX Primer:

http://pivot.apache.org/tutorials/wtkx-primer.html

For example, in your code below, you'll want to use <componentKeyListeners> rather than <keyListeners>. The element name maps directly to a JavaBean property representing the listener list in the source component (getComponentKeyListeners()).


On Feb 22, 2010, at 7:22 PM, Michael Bushe wrote:

> I'm trying to add a keyListener in WTKX.  I gave this a shot:
>                    <keyListeners>
>                        <wtkx:script>
>                            function keyTyped(component, keyCode) {
>                                if (keyCode == Keyboard.KeyCode.ENTER) {
>                                       callMyFunction();
>                                }
>                            }
>                        </wtkx:script>
>                    </keyListeners>
> 
> OK, giving me a fish and telling me how to do is nice, but I want the rod.
> Where can I find the Schema or DTD?  Is there a link on the site?  I couldn't find it.
> 
> I tried to search the mailing list too, but the mailing list link doesn't have a
> search:
> http://mail-archives.apache.org/mod_mbox/pivot-user/ (and clicking a link
> there):
> http://mail-archives.apache.org/mod_mbox/pivot-user/201002.mbox/browser
> 
> Michael Bushe
> Principal
> Bushe Enterprises, Inc.
> michael@bushe.com
> www.bushe.com


Re: WTKX Key Listener and Schema

Posted by Michael Bushe <mi...@bushe.com>.
DOH!  Thanks.  I'm just so used to KeyListener's I didn't catch that.

Michael Bushe
Principal
Bushe Enterprises, Inc.
michael@bushe.com
www.bushe.com


On Mon, Feb 22, 2010 at 7:22 PM, Michael Bushe <mi...@bushe.com> wrote:

> I'm trying to add a keyListener in WTKX.  I gave this a shot:
>                    <keyListeners>
>                        <wtkx:script>
>                            function keyTyped(component, keyCode) {
>                                if (keyCode == Keyboard.KeyCode.ENTER) {
>                                       callMyFunction();
>                                }
>                            }
>                        </wtkx:script>
>                    </keyListeners>
>
> OK, giving me a fish and telling me how to do is nice, but I want the rod.
> Where can I find the Schema or DTD?  Is there a link on the site?  I
> couldn't find it.
>
> I tried to search the mailing list too, but the mailing list link doesn't
> have a
> search:
> http://mail-archives.apache.org/mod_mbox/pivot-user/ (and clicking a link
> there):
> http://mail-archives.apache.org/mod_mbox/pivot-user/201002.mbox/browser
>
> Michael Bushe
> Principal
> Bushe Enterprises, Inc.
> michael@bushe.com
> www.bushe.com
>