javax.faces.webapp.UIComponentClassicTagBase.setProperties()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(67)

本文整理了Java中javax.faces.webapp.UIComponentClassicTagBase.setProperties()方法的一些代码示例,展示了UIComponentClassicTagBase.setProperties()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UIComponentClassicTagBase.setProperties()方法的具体详情如下:
包路径:javax.faces.webapp.UIComponentClassicTagBase
类名称:UIComponentClassicTagBase
方法名:setProperties

UIComponentClassicTagBase.setProperties介绍

[英]Override properties and attributes of the specified component, if the corresponding properties of this tag handler instance were explicitly set. This method must be called ONLY if the specified UIComponent was in fact created during the execution of this tag handler instance, and this call will occur BEFORE the UIComponent is added to the view.

Tag subclasses that want to support additional set properties must ensure that the base class setProperties() method is still called. A typical implementation that supports extra properties foo and bar would look something like this:

protected void setProperties(UIComponent component) { 
super.setProperties(component); 
if (foo != null) { 
component.setAttribute("foo", foo); 
} 
if (bar != null) { 
component.setAttribute("bar", bar); 
} 
}

The default implementation overrides the following properties:

  • rendered - Set if a value for the rendered property is specified for this tag handler instance.
  • rendererType - Set if the getRendererType() method returns a non-null value.
    [中]如果显式设置了此标记处理程序实例的相应属性,则重写指定组件的属性和属性。仅当指定的UIComponent实际上是在此标记处理程序实例的执行过程中创建的,并且此调用将在UIComponent添加到视图之前发生时,才必须调用此方法。
    想要支持其他集合属性的标记子类必须确保基类setProperties()方法仍然被调用。支持额外属性foobar的典型实现如下所示:
protected void setProperties(UIComponent component) { 
super.setProperties(component); 
if (foo != null) { 
component.setAttribute("foo", foo); 
} 
if (bar != null) { 
component.setAttribute("bar", bar); 
} 
}

默认实现会覆盖以下属性:
*rendered-设置是否为此标记处理程序实例指定了rendered属性的值。
*rendererType-设置getRendererType()方法是否返回非空值。

代码示例

代码示例来源:origin: org.apache.myfaces/com.springsource.org.apache.myfaces.javax.faces

setProperties(_componentInstance);
setProperties(_componentInstance);

代码示例来源:origin: org.apache.myfaces.core/myfaces-api

setProperties(_componentInstance);
setProperties(_componentInstance);

代码示例来源:origin: javax.faces/com.springsource.javax.faces

setProperties(parentComponent);
setProperties(parentComponent);

代码示例来源:origin: org.jboss.spec.javax.faces/jboss-jsf-api_2.0_spec

setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {
} else if (hasBinding()) {
  try {
    setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {

代码示例来源:origin: org.glassfish/javax.faces

setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {
} else if (hasBinding()) {
  try {
    setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {

代码示例来源:origin: com.sun.faces/jsf-api

setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {
} else if (hasBinding()) {
  try {
    setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {

代码示例来源:origin: javax/javaee-web-api

setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {
} else if (hasBinding()) {
  try {
    setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {

代码示例来源:origin: eclipse-ee4j/mojarra

setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {
} else if (hasBinding()) {
  try {
    setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {

代码示例来源:origin: jboss/jboss-javaee-specs

setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {
} else if (hasBinding()) {
  try {
    setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {

代码示例来源:origin: javax.faces/javax.faces-api

setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {
} else if (hasBinding()) {
  try {
    setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {

代码示例来源:origin: org.glassfish/jakarta.faces

setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {
} else if (hasBinding()) {
  try {
    setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {

代码示例来源:origin: eclipse-ee4j/mojarra

setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {
} else if (hasBinding()) {
  try {
    setProperties(parentComponent);
  } catch (FacesException e) {
    if (e.getCause() instanceof JspException) {

相关文章

微信公众号

最新文章

更多

UIComponentClassicTagBase类方法