When developing custom tags in JSF, the setting of the id attribute value is not the same as the general properties:
if (this.id!=null) {
Component.setvalueexpression ("id", this.id);
}
If this setting runs, the java.lang.IllegalArgumentException exception is reported because the expression name is detected in the setvalueexpression side of the UIComponent class as "id" or " Parent "throws a Java.lang.IllegalArgumentException exception.
The correct approach is to:
Elcontext Elcontext = Facescontext.getcurrentinstance (). Getelcontext ();
if (this.id!=null) {
Component.setid ((String) This.id.getValue (Elcontext));
}
How the Var property value is set
if (this.var!=null) {
((htmldatatable) component). SetVar ((String) This.var.getValue (Elcontext));
This article links http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20130121/36376.html
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.