I experienced the following, when I ran your test case. I changed the code to set focus to the login field. When I ran the app, I did not see the blinking text entry cursor, until I clicked in the input field. However, when I reloaded the application, the text entry cursor was focused properly when the app started up. After that, the field was focused every time I reloaded that app. Strange....
I'm going to see if I can get a smaller test case that is reproducible, and then file a bug. On Mon, Oct 5, 2009 at 5:46 PM, Omar BELKHODJA <[email protected]>wrote: > Yes, true. It was just a try to check if it works. I don't really need to > set the focus to the parent. But the result seems to be the same. > > Henry Minsky a écrit : > >> 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]<mailto: >> [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] <mailto:[email protected]> >> >> >> > -- Henry Minsky Software Architect [email protected]
