0

How to catch tab button pressed

asked 2010-07-27 14:23:03 +0800

Arsen gravatar image Arsen
384 5

Good day, guys.
I've got grid with a lot of controls in each row. User navigates through these controls using tab button. And when he presses tab on the last control in the row, then new row is automaticaly created.
I used Events.ON_BLUR event for the last control, but there is problem: focus on last control, but user select another one with mouse, onBlur is triggered and new row created, while it should not.
So I need to catch tab button clicked. And one more thing - all gui part is created on java side, I don't have any zul files, so need java-side solution.

I've tried ctrlKeys="#tab", but page hangs with this code no errors just infinite "Loading" message, see example

 <window width="100%" height="100%">
        <textbox id="t1" ctrlKeys="#tab"/>
        <textbox id="t2"/>
        <zscript>
            t1.addEventListener(Events.ON_CTRL_KEY, new EventListener(){
            public void onEvent(Event event) throws Exception {
                System.out.println("t1");
            }});
        </zscript>
    </window>

delete flag offensive retag edit

4 Replies

Sort by » oldest newest

answered 2010-07-28 06:00:42 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

Please post to ZK bugs so we can track it. Thanks. And which version of ZK and browser you are testing on?

link publish delete flag offensive edit

answered 2010-07-28 16:05:21 +0800

Arsen gravatar image Arsen
384 5

How can I post it as a bug? I use Chrome, but the same bug reproduced on IE and Firefox. ZK 5.0.3-FL CE (build: 2010062319)
IE shows js exception

Сообщение: Исключение брошено и не поймано
Строка: 2
Символ: 2074
Код: 0
URI-код: http://localhost:8080/Vseveda/zkau/web/_zv2010062319/js/zul.wpd;jsessionid=add6bd01a996ff0001be256dd4a8

link publish delete flag offensive edit

answered 2010-07-28 22:04:03 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

>> I've tried ctrlKeys="#tab", but page hangs with this code no errors just infinite "Loading" message, see example

https://sourceforge.net/tracker/?group_id=152762&atid=785191

--

As for your use case. Can you "hide" a focusable component after the last row and listen to "onFocus" of that component to add the new row?

link publish delete flag offensive edit

answered 2010-07-28 22:38:53 +0800

Arsen gravatar image Arsen
384 5

henrichen, thank you for idea. I'll try it.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-07-27 14:23:03 +0800

Seen: 311 times

Last updated: Jul 28 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More