By: Kadhar Viewed: 153227 times Printer Friendly Format
When you set the id for a TreeNode are you getting an illegal Argument exception.
String id = "0C00EC8C-E1";
TreeNode node = new TreeNode;
This code may throw an IllegalArgument exception. To solve this problem you need to u need to adhere to the contract of UIComponent.setId():
- Must not be a zero-length String.
- First character must be a letter or an underscore ('_').
- Subsequent characters must be a letter, a digit, an underscore ('_'), or a dash ('-').
- Component identifiers must also obey the following semantic restrictions (note that this restriction is NOT enforced by the setId() implementation):
- The specified identifier must be unique among all the components (including facets) that are descendents of the nearest ancestor UIComponent that is a NamingContainer, or within the scope of the entire component tree if there is no such ancestor that is a NamingContainer.
This should solve your problem.
Most Viewed Articles (in JSF )
Latest Articles (in JSF)
Comment on this tutorial
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews