Skip to main content
Legend
November 6, 2012
Answered

FocusManager breakage on return to a view with destructionPolicy="never"

  • November 6, 2012
  • 2 replies
  • 451 views

Hi,

OK, so I have a view based application with an underlying view containing a core module of my application that I want to keep available. Therefore, I have set destructionPolicy="never" to keep it in memory. This works.

I also have a TextArea that I add to the view at various times and call TextArea.setFocus(); to draw up the soft keyboard on update complete. This works.

I also have a separate view that I push onto my ViewNavigator to perform a couple of related tasks, then pop it off to return to the main view once I am done. This works.

BUT...

When I return from displaying my subview, focusManager will no longer respond to my TextArea.setFocus() call.

EG: focusManager.getFocus() returns null no matter how often nor in what manner I call TextArea.setFocus();

This means that I can no longer edit any text in my main view.

Short of a (non-trivial and undesirable) workaround to replace the main view every time, which would mean re-architecting the core and unnecessarily reinitialising a number of display objects, is there any reason anybody can see for focusManager to fail in this way?

Cheers,

G

This topic has been closed for replies.
Correct answer Gaius Coffey

Dagnamit and gnnngringichyeAAUUUUURGHH!

OK, so I've found _one_ of the issues...

I was using stage text skin as I wanted (_NEEDED_) to use the spell checker and so to eliminate a costly and unnecessary programming subsystem from this legacy app. Trouble is, the stage text skin and _only_ the stage text skin is utterly, utterly banjaxed by views being added and removed.

 

skinClass

:ClassReference("spark.skins.mobile.StageTextAreaSkin"

);

Once I swapped to TextAreaSkin everything worked the way it was meant to...

 

skinClass

:ClassReference("spark.skins.mobile.TextAreaSkin"

);

Apart, that is, from the (@{{ing spell correction.

Grr. Now to add the spell checker back in... Some how.

G

2 replies

Legend
November 8, 2012

Hi,

Just bumping this one as it is becoming a major issue - essentially, I cannot rely on the ability for a user to input _text_!

Thanks,

G

Gaius CoffeyAuthorCorrect answer
Legend
November 8, 2012

Dagnamit and gnnngringichyeAAUUUUURGHH!

OK, so I've found _one_ of the issues...

I was using stage text skin as I wanted (_NEEDED_) to use the spell checker and so to eliminate a costly and unnecessary programming subsystem from this legacy app. Trouble is, the stage text skin and _only_ the stage text skin is utterly, utterly banjaxed by views being added and removed.

 

skinClass

:ClassReference("spark.skins.mobile.StageTextAreaSkin"

);

Once I swapped to TextAreaSkin everything worked the way it was meant to...

 

skinClass

:ClassReference("spark.skins.mobile.TextAreaSkin"

);

Apart, that is, from the (@{{ing spell correction.

Grr. Now to add the spell checker back in... Some how.

G