Hi Daniel,

in partly works for me. With the code you suggested I get a list of
suggestions when clicking into the TextField(). However, the list of
suggestions has only strings stored from other websites and is not updated
on rpcAsync() backend calls. The fields are also not automatically filled on
loading the page (or the login screen appearance). I am not really sure what
the problem is.

Anyway, as it gives me much more control, I decided to implement the storing
and loading of the login screen fields myself using HTML5 localStorage:

   supports_html5_storage = function() {
       try { return 'localStorage' in window && window['localStorage'] !== 
null; }
       catch (e) { return false;
   };

   var username = new qx.ui.form.TextField();
   this.addListener('appear', function() {
       if (supports_html5_storage() && localStorage.getItem('myUsername') != 
null) {
           username.setValue(localStorage.getItem('myUsername'));
       }
   }, this;

   this.loginHandler : function(ret, exc) {
       if (exc) {
           alert('Login error');
       }
       else {
           if (supports_html5_storage()) {
               localStorage.setItem('myUsername', username.getValue());
           }
       }
   };

   Doing the same for the password field and adding a check box "Remember me"
   gives all the functionality needed.

Cheers,
Fritz

On Fri, 12 Dec 2014, Daniel Wagner wrote:

> Hi Fritz,
>
> that's strange, it works for me (in Chrome and Firefox) with just this code:
>
>      var input = new qx.ui.form.TextField();
>      input.getContentElement().setAttribute("name", "username");
>      this.getRoot().add(input);
>
> A form tag should not be necessary, but you might try also setting the
> "autocomplete" attribute to "on", although that should be the default.
>
>
> Regards,
> Daniel
>
> On 11.12.2014 22:54, Fritz Zaucker wrote:
>> Hi Daniel,
>>
>> thanks for the reply. Thie seems not enough, though. Do the fields have to
>> be inside a HTML <form></form>? I just placed them in a qx.ui.window.Window 
>> with a
>> qx.ui.layout.Grid layout at the moment. Or anything else I have to do?
>>
>> I am submitting the username/password with  qx.io.remote.Rpc.callAsync().
>>
>> Ideally the username/password would be filled in by the browser when the
>> login window appears ...
>>
>> Cheers,
>> Fritz
>>
>> On Thu, 11 Dec 2014, Daniel Wagner wrote:
>>
>>> you just have to give your field a "name" (or alternatively "id")
>>> attribute so the browser knows how to store the value:
>>>
>>> input.getContentElement().setAttribute("name", "username");
>>>
>>> Regards,
>>> Daniel
>>>
>>> On 10.12.2014 23:32, Fritz Zaucker wrote:
>>>> Hi,
>>>>
>>>> is it possible to have Qooxdoo TextFields filled automatically by the
>>>> browser? Like on a login screen the username and password field?
>>>>
>>>> I am using a qx.ui.window.Window() with a qx.ui.form.TextFields() and a
>>>> qx.ui.form.PasswordField(), but they are not filled when the application is
>>>> started.
>>>>
>>>> Thanks,
>>>> Fritz

-- 
Oetiker+Partner AG              tel: +41 62 775 9903 (direct)
Fritz Zaucker                        +41 62 775 9900 (switch board)
Aarweg 15                            +41 79 675 0630 (mobile)
CH-4600 Olten                   fax: +41 62 775 9905
Schweiz                         web: www.oetiker.ch

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to