PDA

View Full Version : Username/Password fields within login.lzx


rolfpf
02-20-2005, 05:30 PM
I am extending the Login feature of the dashboard application where the user has to enter the username and password which is then passed to the Authenticate.class for validation.

My problem is in the code below: when I want to capture the username I use username.text and it returns the username that was entered into the field. When I use passid.text to retrieve the password I get a blank.

Anyone know how I can capture the password as shown below?

Code:----------------------------------------------

<view name="loginView" x="70" y="35" width="${ parent.width }">
<view>
<text x="2" y="2" width="200" height="35">
<font size="11">Sign in to your dashboard</font></text>
</view>
<view layout="axis:y; spacing:4" x="10" y="10" width="200">
<view layout="axis:x" align="right">
<text x="14" y="20">User Name:</text>
<edittext id="username" width="200" x="40" y="20"></edittext>
</view>
<view layout="axis:x" align="right">
<text x="14" y="20">Password:</text>
<edittext id="passid" width="200" x="40" y="20" password="true"></edittext>
</view>
<view layout="axis:x" x="50">
<button name="submit">Submit
<method event="onclick">
var usern = username.text;
var passwd = passid.text;
debug.write("Username"+ usern);
debug.write("Password"+ passwd);
canvas.connection.login(usern, passwd);
</method>
</button>
</view>
</view>
</view>

jey
02-20-2005, 07:21 PM
Your code works in my test environment!

I'm using LPS 3.0b1 and firefox!

Are you still using LPS 2.2?

Jey

rolfpf
02-20-2005, 09:47 PM
Yes I am using Laszlo 2.2.1.

I did however take this from a guy who was running LPS 3.0b and using a login process like this.

I take it that there must be a difference between the versions. The thing that confuses me is that I can get access to the username but not the password.

I don't understand this!

hqm
02-21-2005, 08:25 AM
The example works for me in 3.0b2 (it's in QA right now, due for release very soon )

I don't have a LPS 2.2 to try it in.

rolfpf
02-23-2005, 07:34 PM
For those interested I added setFocus in the above code:

Code--------------------------------------
<method event="onclick">
LzFocus.setFocus(username.text);
var usern = username.text;

And it worked just fine.