[Xerte] Styling text entry fields and setting focus
Tenney Julian
Julian.Tenney at nottingham.ac.uk
Mon Jul 28 09:03:00 BST 2008
The following works for me:
Add an interaction to a page, set perpetual to 1
Add a textEntry to it, give it an rs property of txtUsername;
Add another textEntry to it, give it an rs property of txtPassword;
Add a script below the interaction, call it setup:
txtUsername.background = true;
txtPassword.background = true;
txtPassword.password = true;
That sets up the fields as you need. You need to do this after the
interaction has been setup, hence the perpetual proeprty, allowing the
flow to pass through the interaction after the text fields have been set
up. You code can now access the text fields.
You can then add a button to the interaction, with a script for fishing
out the details the user entered:
debug('username: ' + txtUsername.text + '; password:' +
txtPassword.text);
or handle it with rootIcon.onKeyDown as discussed last week,
J
________________________________
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Paul Swanson
Sent: 25 July 2008 22:12
To: Xerte discussion list
Subject: RE: [Xerte] Styling text entry fields and setting focus
Update:
I've been able to get the look I want, set focus, and designate the
field as a password field by using a V2 TextInput component, but now I
can't get the control off the screen. I can't seem to Tab or Enter out
of the field. I based the setup on the V2Components example, and found
that if you try to use 'change' as the event, only 1 character at a time
appears in the text field. But if I use 'enter' (also tried: Enter,
onEnter, blur, Blur, onBlur, onKillFocus, KillFocus) as the event you
can continue to type characters, but nothing happens when you press Tab
or Enter. The interaction never seems to exit unless I use 'change' as
the event with InteractionId.exit(), but then I only capture the first
character typed. What is the name of the event I should be using if I
want to use Tab or Enter as the action key?
I'm also unsure of how to remove the control from the screen once you've
Entered or Tabbed out of the field. I guess I could use a framework for
that, and just navigate to the next page of the framework.
Paul
________________________________
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Paul Swanson
Sent: Friday, July 25, 2008 11:23 AM
To: Xerte discussion list
Subject: [Xerte] Styling text entry fields and setting focus
I'm building a login page, and I'm having trouble getting the
Text Entry fields to look and work the way I want them too.
I'm using a regular text entry response, but the text field does
not have a white background (page background color is a light blue).
I've tried using a script icon with the following:
pword.pw.background = true;
pword.pw.backgroundColor = 0xFF0000;
pword.pw.password = true;
Where pword is the interaction id, and pw is the rs property of
the text entry response. This is in an Event response attached to the
same Interaction as the text entry response. I'm using an event of
onInit with the icon set to pword, but have also tried setting it to pw.
The text entry field is displayed, but the background of the text field
is the same color as the stage, and text typed into the field is visible
as entered, not masked by the password property. I also want to set the
focus to the text entry fields, but setFocus() doesn't seem to have an
effect.
So how would I do this? It seems I would have to use a script
icon after the response has loaded, but I don't want the interactions to
be perpetual if I can avoid it. Do I use an event response like my above
does, or can I somehow have a setup script on the login page that sets
the styles before the text entry fields are set up?
_____________________________
Paul Swanson
Instructional Designer
Harland Financial Solutions
_____________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20080728/e14d94db/attachment.html
More information about the Xerte
mailing list