0

onChanging don't capture arrows press

asked 2014-05-22 01:42:59 +0800

LuigiC gravatar image LuigiC
1

Hi, I'm trying to build a textbox where an user has the possibility to type some word or have some suggest when ctrl+s is pressed. Now the problem is this: when a user type chars or numbers, or delete some something, the position of text cursor is update, and I can insert the suggestion in the right position. But if the client press any arrows (UP, DOWN, ext), maybe to move to another word or at the last of a phrase, the position of text cursor isn't update and when i want to insert a suggest word, this word is insert in another point. So my question is, can i generate or capture a arrows event?

This is my code:

@Listen("onChanging=#sel") public void onChange(Event event) { if (event instanceof org.zkoss.zk.ui.event.InputEvent) { sc.setCaretPosition(((org.zkoss.zk.ui.event.InputEvent) event) .getStart()); } if (sc.getCtrlYes()) { if (popSel.getChildren().size() != 0) { popSel.close(); popSel.removeChild(popSel.getChildren().get(0)); } ListWord lw = new ListWord(sel, popSel); popSel.appendChild(lw); popSel.open(sel, "after_center"); } }

delete flag offensive retag edit
Be the first one to answer this question!
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
1 follower

RSS

Stats

Asked: 2014-05-22 01:42:59 +0800

Seen: 8 times

Last updated: May 22 '14

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