Dialog - Dynamic Focus

By default, the first input field receives focus automatically. It can be changed by using focus attribute.

Documentation
Dynamic Focus
<h:form> 
    <p:commandButton value="Dynamic Focus" onclick="PF('dlg').show();" type="button" icon="pi pi-home" />
    
    <p:dialog header="Dynamic Focus" widgetVar="dlg" focus="age">
        <h:panelGrid columns="2" cellpadding="5">
            <h:outputLabel for="name" value="Name:" />
            <p:inputText id="name" label="name" />
            
            <h:outputLabel for="surname" value="Surname:" />
            <p:inputText id="surname" label="surname" />
            
            <h:outputLabel for="age" value="Age:" />
            <p:inputText id="age" label="age" />
        </h:panelGrid>
    </p:dialog>       
</h:form>

FREE THEMES

Built-in component themes created by the PrimeFaces Theme Designer.

nova-light Nova-Light
nova-dark Nova-Dark
nova-colored Nova-Colored
luna-blue Luna-Blue
luna-amber Luna-Amber
luna-green Luna-Green
luna-pink Luna-Pink
omega Omega

PREMIUM TEMPLATES

Create awesome applications in no time using the premium templates and impress your users.