MrHackett / iui

Automatically exported from code.google.com/p/iui
MIT License
0 stars 0 forks source link

[PATCH] Add OnLoad event to panel #129

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have some actions I wanted to run when a "panel" loaded the first time.

Usage: <ul onload="func()">

Patch was made against 0.20-beta1

The javascript in the onload call will be called only the first time the
panel is shown.  To execute an action every time the panel gains focus, see
my patch for OnFocus.

Original issue reported on code.google.com by cwzach...@adelphia.net on 29 Apr 2009 at 12:48

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for this, i added it to my project and it works well when using simple 
tests 
such as alert(). 

I only have one issue, which I cannot seem to figure out. I believe there is 
something preventing it from working, but not sure where to look.

When using a field focus "onload" event, 

ie: document.getElementById('fieldname').focus();

It will not work. My main point is that upon the initial login page load, for 
the 
first field for the login form to be highlighted and the keyboard to appear. 
This 
seems to be only acheivable by setting the field focus(), but does not appear 
to 
work on mobile safari, whereas ff3/ie7 do.

NOTE: I have the issue with both this onload script in UL/DIV elements, as well 
as 
with the body onload, neither work.

Original comment by andrewst...@gmail.com on 28 May 2009 at 3:23

GoogleCodeExporter commented 8 years ago
Please add this feature to the next release of iui.

Original comment by mbac...@gmail.com on 31 May 2009 at 8:59

GoogleCodeExporter commented 8 years ago
To Andrew Steed:

If you're going to test your page, you should minimally use Safari for the 
desktop if
you can't test directly on Mobile Safari - it's not identical, but it will give 
you a
better sense for what Mobile Safari will do than FF and IE.

Keep in mind, input is done in a very different way on an iPhone than a
desktop/laptop.  There is no mouse and I'm not entirely sure that focusing on an
input element would cause the virtual keyboard to appear.  

As soon as the user taps on the input field, the keyboard will pop up - is 
there a
reason you want to pro grammatically do that for the user?

Original comment by cwzach...@adelphia.net on 1 Jun 2009 at 6:11

GoogleCodeExporter commented 8 years ago
Thanks cwzach,

Yes i do test directly on mobile safari locally as well as a desktop version of 
safari.  "focus()" should be fairly universal, and as far i know is related to 
keyboard not a mouse when used in the context of an input field.

I use blur() to defocus text fields which does cause the virtual keyboard to 
disappear, as shown in another issue i wrote about in this board.

I've tested this further and fear it's more complex than i thought. It does not 
seem 
related to iUI, but in general for 'onLoad' functions, be it from <body 
onload=""> or 
from a script tag, focus() events dont seem to register, however when calling 
an 
"onClick" event from an anchor tag, it does use the proper focus() action and 
pulls 
up the keyboard.

As of now it appears it's not possible to use focus() with onload, or even 
timers, so 
i'll have to find something else.

The reason for the focus is that it's a login page, with two fields and a 
submit 
button, fairly plain, and would be helpful to users to have it autofocus.

Original comment by andrewst...@gmail.com on 1 Jun 2009 at 8:40

GoogleCodeExporter commented 8 years ago
I also want to achieve this functionality it is always user friendly. did you 
solve this please let me know how to 
auto load the keyborad. gmail is doing this when you click search icon.

thanks

Original comment by mtaufi...@gmail.com on 30 Jun 2009 at 11:33

GoogleCodeExporter commented 8 years ago

Original comment by msgilli...@gmail.com on 7 Aug 2009 at 10:08

GoogleCodeExporter commented 8 years ago

Original comment by msgilli...@gmail.com on 7 Aug 2009 at 10:10