Here's the code:
Code: Select all
<h:form>
<p:commandButton onclick="dialog.show()"
value="Show Dialog"/>
</h:form>
<h:form>
<p:dialog visible="false"
widgetVar="dialog">
<h:panelGrid columns="1">
<p:inputText value="#{user.name}"/>
<p:commandButton update="output"
value="Greet me!"/>
</h:panelGrid>
<h:outputText id="output" value="Hello #{user.name}!"/>
</p:dialog>
</h:form>
Code: Select all
import javax.faces.bean.ManagedBean;
@ManagedBean
public class User {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Regards,
Philip