[
http://issues.apache.org/jira/browse/TAPESTRY-1113?page=comments#action_12443667
]
Greg Woolsey commented on TAPESTRY-1113:
----------------------------------------
Snapshot 4.1.1-20061017.225719-37 appears to have at least some of this code
working now - it at least attempts to focus the first field.
However, if the first focusable component is a SELECT list (in my case a custom
component, but I checked and PropertySelection will do this too), you get a
JavaScript error. The problem is that Tapestry emits this kind of JavaScript:
tapestry.form.focusField('fromCurrencyList');
which looks like this:
focusField:function(field){
if (arguments.length < 1) return;
field = dojo.byId(field);
if (!field) return;
if (field.disabled || field.clientWidth < 1) return;
dojo.html.selectInputText(field);
},
however, this Dojo function is only valid for elements with selectable text,
which SELECT lists don't have. For these (and probably checkboxes, radio
buttons, and maybe file upload form elements) you can only call their focus()
functions.
I like the idea of selecting the text of controls that support it, but I also
want other fields to have the focus some times. And the default behavior
should not throw a JavaScript error of course.
> Form component focus parameter not working in 4.1.1
> ---------------------------------------------------
>
> Key: TAPESTRY-1113
> URL: http://issues.apache.org/jira/browse/TAPESTRY-1113
> Project: Tapestry
> Issue Type: Bug
> Components: Framework, JavaScript, Core
> Affects Versions: 4.1.1
> Reporter: Greg Woolsey
>
> Regression from 4.0.x - there is no code that outputs JavaScript to tell the
> page which form to focus, so no form element gets the initial focus.
> Perhaps this could be done as an optional parameter to
> tapestry.form.registerForm(id). If multiple have focus set, last one wins?
> Users have to manage that to avoid ambiguity, as they do now.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]