Making a defined text input have the default focus

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Making a defined text input have the default focus

Sebastian Sastre-2
Hi there,
 
    anybody knows how one can make that a component's form (only one in this case) have one of it's input fields with focus so user can start typing on that component's load instead of having to click on it first?
 
    thanks,
 

Sebastian Sastre

 

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Making a defined text input have the default focus

Boris Popov, DeepCove Labs (SNN)
(html textInput)
  setFocus;
  size: 16;
  value: self username;
  callback: [:v | self username: v]

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Sebastian Sastre
> Sent: Wednesday, May 09, 2007 3:59 PM
> To: 'Seaside - general discussion'
> Subject: [Seaside] Making a defined text input have the default focus
>
> Hi there,
>
>     anybody knows how one can make that a component's form (only one
in
> this case) have one of it's input fields with focus so user can start
> typing on that component's load instead of having to click on it
first?
>
>     thanks,
>
> Sebastian Sastre
>
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Making a defined text input have the default focus

Sebastian Sastre-2
Thanks Boris! For the login and other simple forms it did the trick. I have
this other component with a periodical updater that every N seconds
refreshes some div (the input is in another div outside it) that is ignoring
the focus set. Do you know about #setFocus effect beign neutralized by an
updater scritp?

Regards,

Sebastian


> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En nombre
> de Boris Popov
> Enviado el: Miércoles, 09 de Mayo de 2007 20:05
> Para: Seaside - general discussion
> Asunto: RE: [Seaside] Making a defined text input have the
> default focus
>
> (html textInput)
>   setFocus;
>   size: 16;
>   value: self username;
>   callback: [:v | self username: v]
>
> -Boris
>
> --
> +1.604.689.0322
> DeepCove Labs Ltd.
> 4th floor 595 Howe Street
> Vancouver, Canada V6C 2T5
> http://tinyurl.com/r7uw4
>
> [hidden email]
>
> CONFIDENTIALITY NOTICE
>
> This email is intended only for the persons named in the
> message header. Unless otherwise indicated, it contains
> information that is private and confidential. If you have
> received it in error, please notify the sender and delete the
> entire message including any attachments.
>
> Thank you.
>
> > -----Original Message-----
> > From: [hidden email] [mailto:seaside-
> > [hidden email]] On Behalf Of Sebastian Sastre
> > Sent: Wednesday, May 09, 2007 3:59 PM
> > To: 'Seaside - general discussion'
> > Subject: [Seaside] Making a defined text input have the
> default focus
> >
> > Hi there,
> >
> >     anybody knows how one can make that a component's form (only one
> in
> > this case) have one of it's input fields with focus so user
> can start
> > typing on that component's load instead of having to click on it
> first?
> >
> >     thanks,
> >
> > Sebastian Sastre
> >
> >
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Making a defined text input have the default focus

Boris Popov, DeepCove Labs (SNN)
If you look at the implementation you'll notice it basically adds a small javascript snippet at the bottom of the page so that when your page finishes loading the focus is set to the field you specify. I imagine you can just try,

html script: 'setFocus(' , brush id printString , ')'

instead when you're creating content for updater. If that works, extract into something that's nicer and more reusable ;)

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Sebastian Sastre
> Sent: Thursday, May 10, 2007 11:05 AM
> To: 'Seaside - general discussion'
> Subject: RE: [Seaside] Making a defined text input have the default focus
>
> Thanks Boris! For the login and other simple forms it did the trick. I
> have
> this other component with a periodical updater that every N seconds
> refreshes some div (the input is in another div outside it) that is
> ignoring
> the focus set. Do you know about #setFocus effect beign neutralized by an
> updater scritp?
>
> Regards,
>
> Sebastian
>
>
> > -----Mensaje original-----
> > De: [hidden email]
> > [mailto:[hidden email]] En nombre
> > de Boris Popov
> > Enviado el: Miércoles, 09 de Mayo de 2007 20:05
> > Para: Seaside - general discussion
> > Asunto: RE: [Seaside] Making a defined text input have the
> > default focus
> >
> > (html textInput)
> >   setFocus;
> >   size: 16;
> >   value: self username;
> >   callback: [:v | self username: v]
> >
> > -Boris
> >
> > --
> > +1.604.689.0322
> > DeepCove Labs Ltd.
> > 4th floor 595 Howe Street
> > Vancouver, Canada V6C 2T5
> > http://tinyurl.com/r7uw4
> >
> > [hidden email]
> >
> > CONFIDENTIALITY NOTICE
> >
> > This email is intended only for the persons named in the
> > message header. Unless otherwise indicated, it contains
> > information that is private and confidential. If you have
> > received it in error, please notify the sender and delete the
> > entire message including any attachments.
> >
> > Thank you.
> >
> > > -----Original Message-----
> > > From: [hidden email] [mailto:seaside-
> > > [hidden email]] On Behalf Of Sebastian Sastre
> > > Sent: Wednesday, May 09, 2007 3:59 PM
> > > To: 'Seaside - general discussion'
> > > Subject: [Seaside] Making a defined text input have the
> > default focus
> > >
> > > Hi there,
> > >
> > >     anybody knows how one can make that a component's form (only one
> > in
> > > this case) have one of it's input fields with focus so user
> > can start
> > > typing on that component's load instead of having to click on it
> > first?
> > >
> > >     thanks,
> > >
> > > Sebastian Sastre
> > >
> > >
> > _______________________________________________
> > Seaside mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Making a defined text input have the default focus

Sebastian Sastre-2

Yes I saw it with Firebug, that by the way I had to tell that I don't know
why it is putting in the script tab all the page code in two lines. The
second line has about three meters long! How one can debug that? Anyway I've
done what you said to test and it worked, but as the component I was making
was a chat room, the input field for the text needed one setFocus more to
produce the complete chat experience.


So.. then I've put that code into
WARenderCanvas>>setFocusTo: anId

        self script: 'setFocus("',anId ,'")'

        and called it from the component rendering method where I've needed.

        cheers!

Sebastian
PD: That extension I've made it to go to a package of my own as loose method
but I think that should be integrated into Seaside because controlling focus
on desktop applications is a very frequent task.


> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En nombre
> de Boris Popov
> Enviado el: Jueves, 10 de Mayo de 2007 15:09
> Para: Seaside - general discussion
> Asunto: RE: [Seaside] Making a defined text input have the
> default focus
>
> If you look at the implementation you'll notice it basically
> adds a small javascript snippet at the bottom of the page so
> that when your page finishes loading the focus is set to the
> field you specify. I imagine you can just try,
>
> html script: 'setFocus(' , brush id printString , ')'
>
> instead when you're creating content for updater. If that
> works, extract into something that's nicer and more reusable ;)
>
> -Boris
>
> --
> +1.604.689.0322
> DeepCove Labs Ltd.
> 4th floor 595 Howe Street
> Vancouver, Canada V6C 2T5
> http://tinyurl.com/r7uw4
>
> [hidden email]
>
> CONFIDENTIALITY NOTICE
>
> This email is intended only for the persons named in the
> message header. Unless otherwise indicated, it contains
> information that is private and confidential. If you have
> received it in error, please notify the sender and delete the
> entire message including any attachments.
>
> Thank you.
>
> > -----Original Message-----
> > From: [hidden email] [mailto:seaside-
> > [hidden email]] On Behalf Of Sebastian Sastre
> > Sent: Thursday, May 10, 2007 11:05 AM
> > To: 'Seaside - general discussion'
> > Subject: RE: [Seaside] Making a defined text input have the default
> > focus
> >
> > Thanks Boris! For the login and other simple forms it did
> the trick. I
> > have this other component with a periodical updater that every N
> > seconds refreshes some div (the input is in another div outside it)
> > that is ignoring the focus set. Do you know about #setFocus effect
> > beign neutralized by an updater scritp?
> >
> > Regards,
> >
> > Sebastian
> >
> >
> > > -----Mensaje original-----
> > > De: [hidden email]
> > > [mailto:[hidden email]] En nombre de
> > > Boris Popov Enviado el: Miércoles, 09 de Mayo de 2007 20:05
> > > Para: Seaside - general discussion
> > > Asunto: RE: [Seaside] Making a defined text input have
> the default
> > > focus
> > >
> > > (html textInput)
> > >   setFocus;
> > >   size: 16;
> > >   value: self username;
> > >   callback: [:v | self username: v]
> > >
> > > -Boris
> > >
> > > --
> > > +1.604.689.0322
> > > DeepCove Labs Ltd.
> > > 4th floor 595 Howe Street
> > > Vancouver, Canada V6C 2T5
> > > http://tinyurl.com/r7uw4
> > >
> > > [hidden email]
> > >
> > > CONFIDENTIALITY NOTICE
> > >
> > > This email is intended only for the persons named in the message
> > > header. Unless otherwise indicated, it contains
> information that is
> > > private and confidential. If you have received it in
> error, please
> > > notify the sender and delete the entire message including any
> > > attachments.
> > >
> > > Thank you.
> > >
> > > > -----Original Message-----
> > > > From: [hidden email]
> [mailto:seaside-
> > > > [hidden email]] On Behalf Of
> Sebastian Sastre
> > > > Sent: Wednesday, May 09, 2007 3:59 PM
> > > > To: 'Seaside - general discussion'
> > > > Subject: [Seaside] Making a defined text input have the
> > > default focus
> > > >
> > > > Hi there,
> > > >
> > > >     anybody knows how one can make that a component's
> form (only
> > > > one
> > > in
> > > > this case) have one of it's input fields with focus so user
> > > can start
> > > > typing on that component's load instead of having to click on it
> > > first?
> > > >
> > > >     thanks,
> > > >
> > > > Sebastian Sastre
> > > >
> > > >
> > > _______________________________________________
> > > Seaside mailing list
> > > [hidden email]
> > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> > _______________________________________________
> > Seaside mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside