File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Exception:p:datatable should be within the form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Exception:p:datatable should be within the form" Watch "Exception:p:datatable should be within the form" New topic

Exception:p:datatable should be within the form

N Deepu

Joined: Jul 28, 2011
Posts: 25


I'm trying to bind a p:datatable from JSF 2.0 Custom Component through Encode Method and I'm able to bind it also, with an issue.

This is my custom Tag in the xhtml page :

and at the encode method i've the following :

But when I try to run this it throws an exception saying p:datatable has to be within a form element, though my custom tag is within h:form tag

So I tried adding this line :

Now it adds the datatable. But one table within the custom tag as I'm doing this in encode method and one more in the form at the top as I've added to the form.

How do I solve this issue? Kindly help me out.

Thanks in advance
I agree. Here's the link:
subject: Exception:p:datatable should be within the form
Similar Threads
DataTable and UploadFile
To update a dataTable from backing bean using p:commandbutton
Can't set invisible border for Table inside P:dataTable.
Selected Row in primefaces
Trouble updating primefaces component w/ajax