📄 uicomponentbase.html
字号:
<p>The return from this method must be the same value throughout the lifetime of the instance, unless the <code>id</code> property of the component is changed, or the component is placed in a <A HREF="../../../javax/faces/component/NamingContainer.html" title="interface in javax.faces.component"><CODE>NamingContainer</CODE></A> whose client ID changes (for example, <A HREF="../../../javax/faces/component/UIData.html" title="class in javax.faces.component"><CODE>UIData</CODE></A>). However, even in these cases, consecutive calls to this method must always return the same value. The implementation must follow these steps in determining the clientId:</p> <p>Find the closest ancestor to <b>this</b> component in the view hierarchy that implements <code>NamingContainer</code>. Call <code>getContainerClientId()</code> on it and save the result as the <code>parentId</code> local variable. Call <A HREF="../../../javax/faces/component/UIComponent.html#getId()"><CODE>UIComponent.getId()</CODE></A> on <b>this</b> component and save the result as the <code>myId</code> local variable. If <code>myId</code> is <code>null</code>, call <code>context.getViewRoot().createUniqueId()</code> and assign the result to myId. If <code>parentId</code> is non-<code>null</code>, let <code>myId</code> equal <code>parentId + NamingContainer.SEPARATOR_CHAR + myId</code>. Call <A HREF="../../../javax/faces/render/Renderer.html#convertClientId(javax.faces.context.FacesContext, java.lang.String)"><CODE>Renderer.convertClientId(javax.faces.context.FacesContext, java.lang.String)</CODE></A>, passing <code>myId</code>, and return the result.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/component/UIComponent.html#getClientId(javax.faces.context.FacesContext)">getClientId</A></CODE> in class <CODE><A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The <A HREF="../../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A> for the current request<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>context</code> is <code>null</code></DL></DD></DL><HR><A NAME="getId()"><!-- --></A><H3>getId</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getId</B>()</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/component/UIComponent.html#getId()">UIComponent</A></CODE></B></DD><DD><p>Return the component identifier of this <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A>.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/component/UIComponent.html#getId()">getId</A></CODE> in class <CODE><A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setId(java.lang.String)"><!-- --></A><H3>setId</H3><PRE>public void <B>setId</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> id)</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/component/UIComponent.html#setId(java.lang.String)">UIComponent</A></CODE></B></DD><DD><p>Set the component identifier of this <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A> (if any). Component identifiers must obey the following syntax restrictions:</p> <ul> <li>Must not be a zero-length String.</li> <li>First character must be a letter or an underscore ('_').</li> <li>Subsequent characters must be a letter, a digit, an underscore ('_'), or a dash ('-').</li> <li> </ul> <p>Component identifiers must also obey the following semantic restrictions (note that this restriction is <strong>NOT</strong> enforced by the <code>setId()</code> implementation):</p> <ul> <li>The specified identifier must be unique among all the components (including facets) that are descendents of the nearest ancestor <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A> that is a <A HREF="../../../javax/faces/component/NamingContainer.html" title="interface in javax.faces.component"><CODE>NamingContainer</CODE></A>, or within the scope of the entire component tree if there is no such ancestor that is a <A HREF="../../../javax/faces/component/NamingContainer.html" title="interface in javax.faces.component"><CODE>NamingContainer</CODE></A>.</li> </ul><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/component/UIComponent.html#setId(java.lang.String)">setId</A></CODE> in class <CODE><A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>id</CODE> - The new component identifier, or <code>null</code> to indicate that this <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A> does not have a component identifier<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>id</code> is not syntactically valid<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE></DL></DD></DL><HR><A NAME="getParent()"><!-- --></A><H3>getParent</H3><PRE>public <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A> <B>getParent</B>()</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/component/UIComponent.html#getParent()">UIComponent</A></CODE></B></DD><DD><p>Return the parent <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A> of this <code>UIComponent</code>, if any. A component must allow child components to be added to and removed from the list of children of this component, even though the child component returns null from <code>getParent( )</code>.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/component/UIComponent.html#getParent()">getParent</A></CODE> in class <CODE><A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setParent(javax.faces.component.UIComponent)"><!-- --></A><H3>setParent</H3><PRE>public void <B>setParent</B>(<A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A> parent)</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/component/UIComponent.html#setParent(javax.faces.component.UIComponent)">UIComponent</A></CODE></B></DD><DD><p>Set the parent <code>UIComponent</code> of this <code>UIComponent</code>. <strong>This method must never be called by developers; a <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A>'s internal implementation will call it as components are added to or removed from a parent's child <code>List</code> or facet <code>Map</code></strong>.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/component/UIComponent.html#setParent(javax.faces.component.UIComponent)">setParent</A></CODE> in class <CODE><A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>parent</CODE> - The new parent, or <code>null</code> for the root node of a component tree</DL></DD></DL><HR><A NAME="isRendered()"><!-- --></A><H3>isRendered</H3><PRE>public boolean <B>isRendered</B>()</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/component/UIComponent.html#isRendered()">UIComponent</A></CODE></B></DD><DD><p>Return <code>true</code> if this component (and its children) should be rendered during the <em>Render Response</em> phase of the request processing lifecycle.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/component/UIComponent.html#isRendered()">isRendered</A></CODE> in class <CODE><A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setRendered(boolean)"><!-- --></A><H3>setRendered</H3><PRE>public void <B>setRendered</B>(boolean rendered)</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/component/UIComponent.html#setRendered(boolean)">UIComponent</A></CODE></B></DD><DD><p>Set the <code>rendered</code> property of this <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A>.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/component/UIComponent.html#setRendered(boolean)">setRendered</A></CODE> in class <CODE><A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component">UIComponent</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>rendered</CODE> - If <code>true</code> render this component; otherwise, do not render this component</DL></DD></DL><HR><A NAME="getRendererType()"><!-- --></A><H3>getRendererType</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getRendererType</B>()</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../javax/faces/component/UIComponent.html#getRendererType()">UIComponent</A></CODE></B></DD><DD><p>Return the <A HREF="../../../javax/faces/render/Renderer.html" title="class in javax.faces.render"><CODE>Renderer</CODE></A> type for this <A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component"><CODE>UIComponent</CODE></A> (if any).</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/faces/component/UIComponent.html#getRendererType()">getRendererType</A></CODE> in class <CODE><A HREF="../../../javax/faces/component/UIComponent.html" title="class in javax.faces.component
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -