jsf 2 - Primefces commandbutton click focus specify id -
i press commandbutton need focus specify id not working in primefaces. try below code:
<h:form id="mainform"> <p:inputtext id="userloginnametextid"/> <p:inputtext id="passwordtextid"/> <p:commandbutton id="useraddbutton" value="#{platform.addbutton}" onfocus="userloginnametextid" action="user.addaction"/> </h:form>
note: tried below attributes in onfocus
onfocus="#mainform:userloginnametextid"
onfocus="#mainform:userloginnametextid"
onfocus="document.getelementid(mainform:userloginnametextid)"
the onfocus event fire if focus commandbutton (and e.g. execute javascript). not used set focus else.
do realy need set focus input clientside when click button?
Comments
Post a Comment