Multiple events from an enter-key press.

Hi,

I’m having a difficult time trying to understand why a enter-key press in a text-field (text-area) generates three requests to the server. I am posting the post-requests above:

265a1b66-b0c6-4d06-82e3-9280813fdb69PID73blurs
265a1b66-b0c6-4d06-82e3-9280813fdb69PID73blurs
265a1b66-b0c6-4d06-82e3-9280813fdb69PID73PID0actiontargetp1PID0actions

This field only uses the blur event listener.

Another interesting thing is that in the sampler application, in the text-area example, enter key is supposed to create a new line and it does in fact. But in my application, only shift-enter do the work. In my case, a “naked” text-area (without any event listeners) still generates the (265a1b66-b0c6-4d06-82e3-9280813fdb69PID73PID0actiontargetp1PID0actions) event and no new line is generated.

I’m using vaadin-6.4.0.jar and Safari or Firefox as browsers.

Is there any way possible to reduce the numbers of requests sent to the server? And is there any information about the enter-key issue? Is shift-enter only, available for creating new-lines?

Thanks a lot for your patience! :slight_smile:

Marcos Alcantara

Hi!

Do you listen for the enter key in some shortcut handler? In this case the enter key is listened in the text area too which then again prevents the new line to appear. Those blur events might actually depend on the same issue as the shortcut handlers need to remove the focus from the active field.

cheers,
matti

Hi Matti,

No, I verified our whole app and didn’t find any place using shorcuts. I still don’t know why that event is being generated. I checked a new application and the same does not occur. So it must be something within our domain. I’ll investigate further. I’m confident something will show up.

Thanks a lot for your help… :slight_smile:

Marcos Alcantara