BTW, Why are you setting the focus to the parent of the edittext, shouldn't
it just be
lz.Focus.setFocus(LoginEdit);
or you could put that in the oninit of the edittext itself ?
On Sat, Oct 3, 2009 at 7:46 PM, Omar BELKHODJA <[email protected]>wrote:
> Hello,
>
> I'm quite new to openlaszlo. I've started a little program with
> login/password window. I want to have the cursor at the starting of the
> application focusing into the login textedit. This doesn't seem to be
> working with the piece of code I've writen (tested in firefox/swf9). Below
> is the source code. Doesn't anybody know why it doesn't work ?
>
> Thanks !
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <canvas id="Canvas" width="100%" height="100%" bgcolor="#EAEAEA"
> align="center" valign="middle">
> <handler name="oninit">
> Debug.debug('canvas init');
> lz.Focus.setFocus(LoginEdit.parent);
> Debug.debug(lz.Focus);
> Debug.inspect(lz.Focus.getFocus());
> </handler>
> <window id="LoginDlg" title="Welcome to Kanfous !" clickable="false"
> width="200" opacity="1" bgcolor="#EAEAEA" x="${(Canvas.width -
> LoginDlg.width) / 2}" y="${(Canvas.height - LoginDlg.height) / 2}">
> <handler name="oninit">
> Debug.debug('window init');
> //this.animate('opacity',1,500,false);
> </handler>
> <simplelayout axis="y" />
> <view width="100%">
> <handler name="oninit">
> Debug.debug('view init');
> </handler>
> <simplelayout axis="x" />
> <text width="60">Login</text>text>
> <edittext id="LoginEdit" width="100%"></edittext>
> </view>
> <view width="100%">
> <simplelayout axis="x"/>
> <text width="60">Password</text>text>
> <edittext id="PasswordEdit" password="true"
> width="100%"></edittext>
> </view>
> <view align="right">
> <simplelayout axis="x" spacing="10" />
> <button onclick="parent.parent.close()">Cancel</button>
> <button onclick="parent.parent.close()"
> isdefault="true">OK</button>
> </view>
> </window>
> </canvas>
>
--
Henry Minsky
Software Architect
[email protected]