Colegas,
O xhtml abaixo é uma simplificação do problema que não estou conseguindo resolver:
Preciso abrir um
Acontece que se eu coloco o
do jQuery('#teste').focus() para setar o foco no elemento testeForm:teste
Vc pode me dizer a sintaxe par o jQuery colocar o foco no testeForm:teste?
Muito obrigado,
Marques
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions">
<h:head></h:head>
<body>
<p:commandButton id="showDialogButton" type="button" value="Show"
onclick="dlg.show()" />
<p:dialog header="" widgetVar="dlg" resizable="false">
<h:form id="form">
<p:commandButton id="submitButton" value="Submit" update=":display"
oncomplete="dlg.hide(); jQuery('#teste').focus()" />
</h:form>
</p:dialog>
<p:outputPanel id="display" style="display:block;margin-top:10px;">
<h:outputText id="name" value="Hello: " />
<p:inputText id="teste" />
</p:outputPanel>
</body>
</html>