[Xerte] text input focus

Julian Tenney Julian.Tenney at nottingham.ac.uk
Fri Aug 27 15:27:21 BST 2010


I think so. What that was about wsa the charPad in the template wizard,
which has buttons loaded with special characters for French, German etc.

 

What happens is the user clicks a button and the special char gets
inserted into the current text field, and the focus is put back to the
text field and IT WORKS IN THE BROWSER so it can be solved...

 

...so looking at the code that does that I see

 

                Selection.setFocus(this.currentTextField);

                Selection.setSelection(this.insertPoint + 1,
this.insertPoint + 1);

 

So, not only is the selection being put back, we also set the selection
range (because we have inserted a character, so need to know where to
put the caret) 

 

But I still can't get my simple example to work.

 

One difference here is that my working code is in a compiled SWF, whilst
the failing code is Xerte code.

 

??

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 27 August 2010 15:08
To: Xerte list
Subject: RE: [Xerte] text input focus

 


Can't see how.
I just have a timer that runs when focus is lost, then drops through to
set it back.
I also removed the onFocus event trap to take that out of the equation.

Think this may have any part?
http://lists.nottingham.ac.uk/pipermail/xerte/2010-January/003835.html 

Is it maybe not getting a usable reference to the TE?
I tried putting both those paths hardcoded in, no luck.
With all the text entries in the templates, I'm gob-smacked no one has
shouted.
Is there a way to do it in XOT?



________________________________

Subject: RE: [Xerte] text input focus
Date: Fri, 27 Aug 2010 14:44:55 +0100
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk

Hm. I don't know what the answer is then. Nothing comes readily to mind
here and I can easily reproduce it. Is the focus getting set and then
stolen by something else?

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 27 August 2010 14:39
To: Xerte list
Subject: RE: [Xerte] text input focus

 


I've already tried stringing it, using a full path
(_level0.engine.answers.txt) strung and unstrung) same routine with a
regular text input interaction, etc etc.
Just less hair.



________________________________

Subject: RE: [Xerte] text input focus
Date: Fri, 27 Aug 2010 14:34:07 +0100
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk

Years ago, in the dark ages of the Flash Player, you would sometimes
have to send a string when a movieclip reference was required. See
http://www.bigresource.com/Tracker/Track-flash-t4zJaAOAHv/

 

Where they are calling Selection.setFocus with a string of the
movieclip's path, not a reference. Some of the old components were foul
of it as well.

 

Give that a whirl.

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 27 August 2010 14:30
To: Xerte list
Subject: RE: [Xerte] text input focus

 


Pat, the problem is with the setFocus itself.
I can't get it to work when browsered, no matter where the original
focus is.

I have a couple dummy start buttons to make sure the piece has focus.
I have a 1 sec timer set up to return focus to the TE if it loses it.

This all works as expected in IDE.
In a browser, none of it works.
The event traps are saying the OnKill and OnSet are tripping, but the
setFocus does nothing.

Attached .rlo

________________________________

Subject: RE: [Xerte] text input focus
Date: Fri, 27 Aug 2010 14:10:22 +0100
From: Patrick.Lockley at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk

Could you write a function to run onload in the flash to do a JS call to
set focus?

 

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 27 August 2010 13:55
To: Xerte list
Subject: RE: [Xerte] text input focus

 


 
OK, in F8 in a browser trying an initial focus on load does not work
because the F object needs to be given focus first.
Add a "Start" button prior to the setFocus attempt and of course it
starts to work because the piece now has focus.
There is a bug in Flash whereby when you set focus to an empty field you
get no caret, but there is a workaround to that.

So the identical setup in Xerte does not want to work.
It is recognizing when the field is gaining or losing focus,  but
Selection.setFocus in the browser does not give the textfield focus i.e.
typing does not appear.

:-/

________________________________

Subject: RE: [Xerte] text input focus
Date: Thu, 26 Aug 2010 19:42:40 +0100
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk

Tried taking Xerte out of the picture and built a simple flash piece?

 

At least that will tell us whether the problem is on our side of things
or not...

 

________________________________

From: xerte-bounces at lists.nottingham.ac.uk on behalf of Dave Burnett
Sent: Thu 26/08/2010 19:31
To: Xerte list
Subject: RE: [Xerte] text input focus

That it doesn't work in a browser?

I stripped it down to bare bones, no embedded fonts, nothing but a
script created text field and a few event catchers.
Works fine in authoring mode, no go in browser.

________________________________

Subject: RE: [Xerte] text input focus
Date: Thu, 26 Aug 2010 13:14:24 +0100
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk

If you're trying to set the focus to the textfield, the movie will get
the focus anyway.

 

What does a simple example tell us?


This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it.
Please do not use, copy or disclose the information contained in this
message or in any attachment. Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham. 
This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system: you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation. 

_______________________________________________ Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte This message and
any attachment are intended solely for the addressee and may contain
confidential information. If you have received this message in error,
please send it back to me, and immediately delete it. Please do not use,
copy or disclose the information contained in this message or in any
attachment. Any views or opinions expressed by the author of this email
do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system: you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation. 


_______________________________________________ Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte This message and
any attachment are intended solely for the addressee and may contain
confidential information. If you have received this message in error,
please send it back to me, and immediately delete it. Please do not use,
copy or disclose the information contained in this message or in any
attachment. Any views or opinions expressed by the author of this email
do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system: you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation. 


_______________________________________________ Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte This message and
any attachment are intended solely for the addressee and may contain
confidential information. If you have received this message in error,
please send it back to me, and immediately delete it. Please do not use,
copy or disclose the information contained in this message or in any
attachment. Any views or opinions expressed by the author of this email
do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system: you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation. 


_______________________________________________ Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte This message and
any attachment are intended solely for the addressee and may contain
confidential information. If you have received this message in error,
please send it back to me, and immediately delete it. Please do not use,
copy or disclose the information contained in this message or in any
attachment. Any views or opinions expressed by the author of this email
do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system: you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20100827/01570ad4/attachment.html


More information about the Xerte mailing list