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 <[EMAIL PROTECTED]> > To: qooxdoo Development <qooxdoo-devel@lists.sourceforge.net> > 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 qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel