I have been struggling with getting focus to work the way I need. Basically, when a user clicks on a button, a dialog with a form opens. However, I don't want for the focus to zoom in on the first inputText in the dialog -- which is what happens right now. It is also the case with the simple Ajax Dialog example in Primefaces showcase, but on the other hand, the login example doesn't not have the focus "issue" so it should be controllable.
Any ideas?
Thanks!!
Here's my code:
Code: Select all
<p:commandButton type="button" value="Add reference" onclick="dlg.show()" image="images/add.png" />
<p:dialog id="dialog" header="New Reference" modal="true" resizable="false"
widgetVar="dlg" underlay="shadow" width="450">
<h:form>
<h:panelGrid columns="4" cellpadding="5">
<h:outputLabel for="value" value="Text" />
<h:inputText id="value" value="#{bean.value}" />
<p:watermark for="pmid" value="Search keyword" />
<p:commandButton value="Search"
onclick="PrimeFaces.cleanWatermarks();" oncomplete="PrimeFaces.showWatermarks();" />
</h:panelGrid>
<p:commandButton value="Submit" update=":display" oncomplete="dlg.hide();"/>
</h:form>
</p:dialog>