My textfield keydown doesn't work in Opera

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

My textfield keydown doesn't work in Opera

jhonny thio
hellooo...

I have a chat application...
It work well in IE and Modzila. I can send message to anyone..
But when I run it on Opera, it can't detect keydown...so when I pressed enter, the program doensn't send the message and nothing happen.

The other is I have a join button. When I pressed it, the application will join to a channel that I choosed before. But it also doesn't work on Opera. Nothing happen when I pressed it.

Please help me. Thank you very much


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: My textfield keydown doesn't work in Opera

Alexander Back
Hi Jhonny,

jhonny thio wrote:
> hellooo...
>
> I have a chat application...
> It work well in IE and Modzila. I can send message to anyone..
> But when I run it on Opera, it can't detect keydown...so when I pressed enter, the program doensn't send the message and nothing happen.
I've just tested a textfield widget with Opera 9.51 and it worked
without a problem.
In which way do you add the listener and try to get the key pressed?

--snip--
var myTextField = new qx.ui.form.TextField();

// the "input" listener will return the whole content of the textfield
myTextField.addEventListener("input", function(e)
{
    this.debug("content " + e.getData());
});

// the "keypress" will only return the pressed key
myTextField.addEventListener("keypress", function(e)
{
   this.debug("pressed key: " + e.getKeyIdentifier());
});
--snip--

The above snippet worked for me, so maybe you try this one :)


> The other is I have a join button. When I pressed it, the application will join to a channel that I choosed before. But it also doesn't work on Opera. Nothing happen when I pressed it.
How do setup the event listener? Normally an "execute" event is fired
which you can listen for. Can you send us over a little code snippet to
track down this issue together?


cheers,
   Alex

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: My textfield keydown doesn't work in Opera

Jonathan Weiß
In reply to this post by jhonny thio
Hello Jhonny!


> But when I run it on Opera, it can't detect keydown...so when I pressed
> enter, the program doensn't send the message and nothing happen.

How to you "detect" keydown events? Do you use something like
myTextField.addListener("keydown", this._foobar, this); ?

Could you send some of your code?


>
> The other is I have a join button. When I pressed it, the application
> will join to a channel that I choosed before. But it also doesn't work
> on Opera. Nothing happen when I pressed it.


It is a bit difficult to help you here. ;-) Opera has powerful developer
tools called "Dragonfly" (http://www.opera.com/products/dragonfly/)
which you can use to easily debug your code. Unfortunately Opera's
developer site (http://dev.opera.com) seems to be unavailable. However,
this would be a good start:
http://dev.opera.com/articles/view/introduction-to-opera-dragonfly


Cheers,

--
Jonathan Rass
Framework Engineer
Core Development :: Web Technologies

1&1 Internet AG
Ernst-Frey-Str. 9
76135 Karlsruhe, Germany
http://www.1und1.de

Amtsgericht Montabaur HRB 6484

Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas
Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss,
Achim Weiss
Aufsichtsratsvorsitzender: Michael Scheeren

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Jonathan Weiß
Framework Engineer

Blog - LinkedIn - XING
Reply | Threaded
Open this post in threaded view
|

Re: My textfield keydown doesn't work in Opera

Alexander Back
In reply to this post by jhonny thio
Hi Jhonny,

please reply to the mailinglist in the future, so other users can also
follow the discussion.

jhonny thio wrote:

> about textfield :
>
> this._mytextfield.addEventListener("keypress", this._onSendMyMessage, this);    
>  
>   _onSendMyMessage: function()
>     {
>         var reqKirimPesan = new qx.io.remote.Request("JtChat/post.php", "POST", "text/plain");
>         reqKirimPesan.setFormField("message", this._mytextfield.getComputedValue());
>         reqKirimPesan.send();
>         this._mytextfield.resetValue();
>        
>        // the Opera doesn't work here, because the this._mytextfield is not clear and remote doesn't send to.
>     }
I'm sure you want to achieve something else with your implementation. At
the moment you send a request AND clear the textfield with every
keypress of the user. How should the user insert any text if you clear
away each character he types? Additionally sending every inserted
character with a single request will for sure drive your server crazy.

In general it is always better to listen to specific events (like
pressing the "enter" key) rather than react on generic events (in your
case: every keypress).

--snip--
  _onSendMyMessage: function(e)
{
         // e is the event object -> key event instance
        if (e.getKeyIdentifier() == "Enter")
        {
           var reqKirimPesan = new qx.io.remote.Request("JtChat/post.php",
"POST", "text/plain");

            // you do not need to use this method -> it uses a form
submit instead of XmlHttp
            //reqKirimPesan.setFormField("message",
this._mytextfield.getComputedValue());

            // add data to the request
           reqKirimPesan.setData(this._mytextfield.getComputedValue());

            reqKirimPesan.send();

           // clear the textfield
           this._mytextfield.setValue("");
         }
}
--snip--
This implementation should also work in Opera.


> about join button :
>
> this._joinButton.addEventListener("execute", this._onJoinAct, this);
>
>     _onJoinAct: function()
>     {
>         var reqKirimPesan = new qx.io.remote.Request("JtChat/post.php", "POST", "text/plain");                        
 >         reqKirimPesan.setFormField("message", "/join 1");
>         reqKirimPesan.send();
>
>         //it also doesn't work in OPERA
>     }
What does not work? As I mentioned in the example above use "setData"
instead of "setFormField" at the request object. The latter method uses
a form submit internally which is for sure not what you intend to use.


cheers,
   Alex


>
> ----- Original Message ----
> From: Alexander Back <[hidden email]>
> To: qooxdoo Development <[hidden email]>
> Sent: Thursday, July 31, 2008 12:46:20 AM
> Subject: Re: [qooxdoo-devel] My textfield keydown doesn't work in Opera
>
> Hi Jhonny,
>
> jhonny thio wrote:
>> hellooo...
>>
>> I have a chat application...
>> It work well in IE and Modzila. I can send message to anyone..
>> But when I run it on Opera, it can't detect keydown...so when I pressed enter, the program doensn't send the message and nothing happen.
> I've just tested a textfield widget with Opera 9.51 and it worked
> without a problem.
> In which way do you add the listener and try to get the key pressed?
>
> --snip--
> var myTextField = new qx.ui.form.TextField();
>
> // the "input" listener will return the whole content of the textfield
> myTextField.addEventListener("input", function(e)
> {
>     this.debug("content " + e.getData());
> });
>
> // the "keypress" will only return the pressed key
> myTextField.addEventListener("keypress", function(e)
> {
>    this.debug("pressed key: " + e.getKeyIdentifier());
> });
> --snip--
>
> The above snippet worked for me, so maybe you try this one :)
>
>
>> The other is I have a join button. When I pressed it, the application will join to a channel that I choosed before. But it also doesn't work on Opera. Nothing happen when I pressed it.
> How do setup the event listener? Normally an "execute" event is fired
> which you can listen for. Can you send us over a little code snippet to
> track down this issue together?
>
>
> cheers,
>    Alex

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel