Disabling form focus?

UI Components for JSF
Post Reply
tomik
Posts: 32
Joined: 21 Jan 2011, 06:50

31 Jan 2011, 06:11

Hi,

I don't have the <p: focus /> on my page, but yet the first input box gets automatically focused once the page is rendered.

Is there a way to turn this feature off?

I am using Primefaces 2.2.RC2-SNAPSHOT, JSF 2, and Spring Web Flow.

Thanks much!

Tom

healeyb
Posts: 365
Joined: 07 Apr 2010, 16:05

31 Jan 2011, 07:32

BTW - what is your first input box? you didn't specify. I just wondered if
you were using something that might have some built in functionality to
do this because I don't see this behaviour without using p:focus or js
equivalent ( <h:body onload="document.getElementById('form:id').focus()"> ).

Regards,
Brendan.

tomik
Posts: 32
Joined: 21 Jan 2011, 06:50

31 Jan 2011, 20:52

I am using a simple <h: inputText> tag. There no such code that you mention.

Somewhere (I think Primefaces documentation) I read that <p: focus /> does not even have to be specified to make the site automatically focus in on the first element of the page's form. I would expect to be able to disable this behavior.

Thanks,

T.

tomik
Posts: 32
Joined: 21 Jan 2011, 06:50

31 Jan 2011, 20:53

I also forgot to mention that this form is in a (Primefaces) dialog.

T.

MarkB
Posts: 17
Joined: 17 Nov 2010, 07:58

03 Feb 2011, 06:45

Do you use <p:focus/> anywhere within the <h:body> section of your page? It will be inherited by all sub-sections once it is defined.
Primefaces 2.2.1 ; Glassfish 3.0.1 (including Mojarra 2.0.3) ; NetBeans 6.9.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 34 guests