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

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

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

UIComponentClassicTagBase.findComponent介绍

[英]Find and return the UIComponent, from the component tree, that corresponds to this tag handler instance. If there is no such UIComponent, create one and add it as a child or facet of the UIComponent associated with our nearest enclosing UIComponentTag. The process for locating or creating the component is:

  1. If we have previously located this component, return it.
  2. Locate the parent component by looking for a parent UIComponentTag instance, and ask it for its component. If there is no parent UIComponentTag instance, this tag represents the root component, so get it from the current Tree and return it.
  3. If this UIComponentTag instance has the facetName attribute set, ask the parent UIComponent for a facet with this name. If not found, create one, call setProperties() with the new component as a parameter, and register it under this name. Return the found or created facet UIComponent.
  4. Determine the component id to be assigned to the new component, as follows: if this UIComponentTag has an id attribute set, use that value; otherwise, generate an identifier that is guaranteed to be the same for this UIComponent every time this page is processed (i.e. one based on the location of all UIComponentTaginstances without an id attribute set).
  5. Ask the parent UIComponent for a child with this identifier. If not found, create one, call setProperties() with the new component as a parameter, and register it as a child with this identifier. Return the found or created child UIComponent.

When creating a component, the process is:

  1. Retrieve the component type by calling UIComponentTag#getComponentType
  2. If the component has a binding attribute, create an expression from it, and call Application#createComponent with that expression, the FacesContext, and the component type. Store the expression using the key "binding".
  3. Otherwise, call Application#createComponent with only the component type.
  4. Call setProperties().
  5. Add the new component as a child or facet of its parent
    [中]从组件树中查找并返回与此标记处理程序实例对应的UIComponent。如果没有这样的UIComponent,创建一个,并将其添加为与最近的封闭UIComponentTag关联的UIComponent的子级或方面。定位或创建组件的过程如下:
    1.如果我们以前找到过该组件,请将其退回。
    1.通过查找父UIComponentTag实例来定位父组件,并要求它提供其组件。如果没有父UIComponentTag实例,那么这个标记代表根组件,所以从当前Tree获取它并返回它。
    1.如果此UIComponentTag实例设置了facetName属性,请向父UIComponent请求具有此名称的方面。如果找不到,则创建一个,以新组件作为参数调用setProperties(),并在此名称下注册。返回找到或创建的组件。
    1.确定要分配给新组件的组件id,如下所示:如果此UIComponentTag设置了id属性,则使用该值;否则,每次处理此页面时,生成一个保证与此UIComponent相同的标识符(即,一个基于所有UIComponentTaginstances(没有id属性集)的位置)。
    1.向父组件请求具有此标识符的子组件。如果找不到,创建一个,以新组件作为参数调用setProperties(),并将其注册为具有此标识符的子级。返回找到或创建的子组件。
    创建组件时,过程如下:
    1.通过调用UIComponentTag#getComponentType来检索组件类型
    1.如果组件具有binding属性,则从中创建一个表达式,并使用该表达式、FacesContext和组件类型调用应用程序#createComponent。使用键[$7$]存储表达式。
    1.否则,只使用组件类型调用应用程序#createComponent。
    1.打电话[$8$]。
    1.将新组件添加为其父组件的子组件或方面

代码示例

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

component = findComponent(context);

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

component = findComponent(context);

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

component = findComponent(context);

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

component = findComponent(context);

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

component = findComponent(context);

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

component = findComponent(context);

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

component = findComponent(context);

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

component = findComponent(context);

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

component = findComponent(context);

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

component = findComponent(context);

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

_componentInstance = findComponent(_facesContext);

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

_componentInstance = findComponent(_facesContext);

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

_componentInstance = findComponent(parent, id);
if (_componentInstance == null)
  else if (null == findComponent(parent,_componentInstance.getId()))

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

_componentInstance = findComponent(parent,id);
if (_componentInstance == null)

相关文章

微信公众号

最新文章

更多

UIComponentClassicTagBase类方法