SetFocus bead

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

SetFocus bead

Carlos Rovira-2
Hi,

just added SetFocus() bead to help Fred here [1]
Although it's a very simple bead, I was having issues making it work, so I added a comment of "warning still not working", but the fact is it seems to work. Don't know why the tests was not working :?

Additionally: You have as well <js:DispatchInputFinishedBead/>

and can be used with:


control.addEventListener(DispatchInputFinishedBead.INPUT_FINISHED, doSomething);


so when control lose focus do something

HTH

Carlos

Reply | Threaded
Open this post in threaded view
|

Re: SetFocus bead

Alex Harui-2

FWIW, it might be worth considering a different approach.  Two issues with putting a bead on a component like this is:

 

  1. Timing: beads are applied very early
  2. Duplication:  There isn’t anything that will detect that you accidentally have this bead on another component somewhere.

 

An alternate approach is to have the SetFocus bead on the container/application strand.  Then it can hook “initComplete” event and it will hopefully be more obvious if you use more than one.

 

HTH,

-Alex

 

From: Carlos Rovira <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Monday, March 23, 2020 at 4:03 PM
To: "[hidden email]" <[hidden email]>
Subject: SetFocus bead

 

Hi,

 

just added SetFocus() bead to help Fred here [1]

Although it's a very simple bead, I was having issues making it work, so I added a comment of "warning still not working", but the fact is it seems to work. Don't know why the tests was not working :?

 

Additionally: You have as well <js:DispatchInputFinishedBead/>



and

can be used with:



 



 

control.addEventListener(DispatchInputFinishedBead.INPUT_FINISHED, doSomething);

 



 

 

so when control lose focus do something

 

HTH

 

Carlos

 

Reply | Threaded
Open this post in threaded view
|

Re: SetFocus bead

Carlos Rovira-2
Hi Alex,

thanks I'll try that as I have time (or if you want to take over feel free), since people reported me that still is not working. The actual approach seems to have an unexpected behaviour

Thanks




El mar., 24 mar. 2020 a las 19:49, Alex Harui (<[hidden email]>) escribió:

FWIW, it might be worth considering a different approach.  Two issues with putting a bead on a component like this is:

 

  1. Timing: beads are applied very early
  2. Duplication:  There isn’t anything that will detect that you accidentally have this bead on another component somewhere.

 

An alternate approach is to have the SetFocus bead on the container/application strand.  Then it can hook “initComplete” event and it will hopefully be more obvious if you use more than one.

 

HTH,

-Alex

 

From: Carlos Rovira <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Monday, March 23, 2020 at 4:03 PM
To: "[hidden email]" <[hidden email]>
Subject: SetFocus bead

 

Hi,

 

just added SetFocus() bead to help Fred here [1]

Although it's a very simple bead, I was having issues making it work, so I added a comment of "warning still not working", but the fact is it seems to work. Don't know why the tests was not working :?

 

Additionally: You have as well <js:DispatchInputFinishedBead/>



and

can be used with:



 



 

control.addEventListener(DispatchInputFinishedBead.INPUT_FINISHED, doSomething);

 



 

 

so when control lose focus do something

 

HTH

 

Carlos

 



--
Reply | Threaded
Open this post in threaded view
|

Re: SetFocus bead

Piotr Zarzycki
Hi Carlos,

I have spent on that focus stuff a lot of time and I gave up. I was able to get proper focus on very first control text input after app initComplete. When I enter to any other view and explicitly make set focus on text input - it doesn't work. It look like focus was always taken by different control.

Thanks,
Piotr


On Tue, Mar 24, 2020, 9:41 PM Carlos Rovira <[hidden email]> wrote:
Hi Alex,

thanks I'll try that as I have time (or if you want to take over feel free), since people reported me that still is not working. The actual approach seems to have an unexpected behaviour

Thanks




El mar., 24 mar. 2020 a las 19:49, Alex Harui (<[hidden email]>) escribió:

FWIW, it might be worth considering a different approach.  Two issues with putting a bead on a component like this is:

 

  1. Timing: beads are applied very early
  2. Duplication:  There isn’t anything that will detect that you accidentally have this bead on another component somewhere.

 

An alternate approach is to have the SetFocus bead on the container/application strand.  Then it can hook “initComplete” event and it will hopefully be more obvious if you use more than one.

 

HTH,

-Alex

 

From: Carlos Rovira <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Monday, March 23, 2020 at 4:03 PM
To: "[hidden email]" <[hidden email]>
Subject: SetFocus bead

 

Hi,

 

just added SetFocus() bead to help Fred here [1]

Although it's a very simple bead, I was having issues making it work, so I added a comment of "warning still not working", but the fact is it seems to work. Don't know why the tests was not working :?

 

Additionally: You have as well <js:DispatchInputFinishedBead/>



and

can be used with:



 



 

control.addEventListener(DispatchInputFinishedBead.INPUT_FINISHED, doSomething);

 



 

 

so when control lose focus do something

 

HTH

 

Carlos

 



--
Reply | Threaded
Open this post in threaded view
|

Re: SetFocus bead

Carlos Rovira-2
Hi Piotr,

good to know it. So definitely something to look at a later time. We have a "setFocus()" method in Jewel TextInput since other controls (button, checkbox) need this too, I want to remove from TextInput an made something more generic, but testing this bead was making different things from time to time...it's the magic of browsers ;)

El mar., 24 mar. 2020 a las 22:16, Piotr Zarzycki (<[hidden email]>) escribió:
Hi Carlos,

I have spent on that focus stuff a lot of time and I gave up. I was able to get proper focus on very first control text input after app initComplete. When I enter to any other view and explicitly make set focus on text input - it doesn't work. It look like focus was always taken by different control.

Thanks,
Piotr


On Tue, Mar 24, 2020, 9:41 PM Carlos Rovira <[hidden email]> wrote:
Hi Alex,

thanks I'll try that as I have time (or if you want to take over feel free), since people reported me that still is not working. The actual approach seems to have an unexpected behaviour

Thanks




El mar., 24 mar. 2020 a las 19:49, Alex Harui (<[hidden email]>) escribió:

FWIW, it might be worth considering a different approach.  Two issues with putting a bead on a component like this is:

 

  1. Timing: beads are applied very early
  2. Duplication:  There isn’t anything that will detect that you accidentally have this bead on another component somewhere.

 

An alternate approach is to have the SetFocus bead on the container/application strand.  Then it can hook “initComplete” event and it will hopefully be more obvious if you use more than one.

 

HTH,

-Alex

 

From: Carlos Rovira <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Monday, March 23, 2020 at 4:03 PM
To: "[hidden email]" <[hidden email]>
Subject: SetFocus bead

 

Hi,

 

just added SetFocus() bead to help Fred here [1]

Although it's a very simple bead, I was having issues making it work, so I added a comment of "warning still not working", but the fact is it seems to work. Don't know why the tests was not working :?

 

Additionally: You have as well <js:DispatchInputFinishedBead/>



and

can be used with:



 



 

control.addEventListener(DispatchInputFinishedBead.INPUT_FINISHED, doSomething);

 



 

 

so when control lose focus do something

 

HTH

 

Carlos

 



--


--