Hello,
I want to implement fields validation in such way: validation at server side and then alerting validation error message.
I impletented it using Request Context and javascript alerting. But customer wants something more beautiful (like p:dialog).
Could you advice some primefaces components for such tasks or explain how to use p:dialog in such situations?
Thanks.
Question about validation implementation
Have a look at the validation in the new login dialog: http://www.primefaces.org:8080/prime-sh ... gLogin.jsf
Perhaps it's what you're after.
Perhaps it's what you're after.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Shaking the dialog is optional, but I think your client will like it.
done, using such way:
and in handleRequest function:
Code: Select all
<p:dialog id="errorDlg" widgetVar="errorDlg" fixedCenter="true" header="Hello">
<h:outputText value="Hello world" />
</p:dialog>
Code: Select all
<script type="text/javascript">
function handleComplete(xhr, status, args) {
var erMes = args.errorMess;
if (erMes) {
document.getElementById("errorDlg_c").style.visibility = "visible";
}
}
</script>
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
You can use errorDlg.hide() as well instead of setting visibility.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
We can't help until seeing the code.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 34 guests