Hi people,
I'm working with a FCKeditor class (org.zkoss.zull.FCKeditor) in my
app (a Chat Tool).
The FCKEditor class is working well, but when I add an
"addEventListener", it does not work.
I want to capture an event when a key is pressed. The event
"onKeyPress" should be fired everytime I press a key (see line 5 in
the code below, please). But it doesn't happen. Can anybody help me,
please?
1 fckEditor = new FCKeditor();
2 fckEditor.setToolbarSet("Basic");
3 fckEditor.setHeight("80px");
4
5 fckEditor.addEventListener("onKeyPress", new EventListener(){
6 public void onEvent(Event e) {
7 KeyEvent evt = ( KeyEvent ) e;
8 if (evt.getKeyCode() == 13) {
9 String message = fckEditor.getValue();
10 sendMessage(message);
11 fckEditor.setValue('');
12 }
13 }
14 });
Best Regards,
Leandro.
I'm working with a FCKeditor class (org.zkoss.zull.FCKeditor) in my
app (a Chat Tool).
The FCKEditor class is working well, but when I add an
"addEventListener", it does not work.
I want to capture an event when a key is pressed. The event
"onKeyPress" should be fired everytime I press a key (see line 5 in
the code below, please). But it doesn't happen. Can anybody help me,
please?
1 fckEditor = new FCKeditor();
2 fckEditor.setToolbarSet("Basic");
3 fckEditor.setHeight("80px");
4
5 fckEditor.addEventListener("onKeyPress", new EventListener(){
6 public void onEvent(Event e) {
7 KeyEvent evt = ( KeyEvent ) e;
8 if (evt.getKeyCode() == 13) {
9 String message = fckEditor.getValue();
10 sendMessage(message);
11 fckEditor.setValue('');
12 }
13 }
14 });
Best Regards,
Leandro.