You need to sign in to do that
Don't have an account?
mworld
inputField Calendar Widget
I have a custom screen with several input fields including one which is a date. For some reason, when the screen loads the calendar widget is always selected and open. This happens whether or not there is a date value to display, regardless of its placement or tab index on the page. This is annoying and confusing to users and does not happen on "stock" pages. Any ideas how to stop this?
Code:
<TD WIDTH="33%"><apex:inputField required="true" value="{!Staff_IP__c.Assigned__c}"/></TD>
Mauricio
<script>
function setFocusOnLoad() {}
</script>
or
<script>beenfocused = true; </script>
All Answers
if not, which does it occur in?
can you post a short sample of a page that does this?
Thanks
It occurs in Firefox 2.0.x.x and IE 7. Both on Windows. Have not tested elsewhere as this is an internal site and other browsers are not used.
By sample page, do you mean a page and controller that use a standard object so you can run it yourself?
Mauricio
I've not see this reported, however is this field the first field of the form?
if so, the date popup occurs when the field is focused , so this could be the issue
Ron:
It's not the first field on the form, but it is the first field on the form that is not a checkbox or dropdown. If I place a text input field above it the focus goes there instead. Unfortunately, in all of the cases I have, I don't have a need for a text input field on the page. Any idea of how to divert the focus?
Mauricio
Here's my InputField code:
The Source code shows that the Calendar widget is coded to open and select a date when it receives focus. It shows that a calendar widget is a text field under the covers. It also shows that my attempts to directly call elementFocus(element) or setNamedFocus(element_name) in functions.js to explicitly re-direct the focus were completely ignored.
The page is coded to set Focus to the first available text input field onLoad.
Does anyone know how to override the focus setting without throwing out VF entirely and writing an entirely hand coded page?
Mauricio
<script>
function setFocusOnLoad() {}
</script>
or
<script>beenfocused = true; </script>
I have a similar problem, but in my case it is a standard Salesforce edit page. I have 2 dropdowns and then a date field. When the user edits the record, the calendar widget automatically pops up.
Is there a way to prevent this?