myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Travis Reeder <tree...@gmail.com>
Subject findComponent() method not finding component
Date Tue, 01 Nov 2005 21:53:15 GMT
Below is the tree print out and you can see that a component with id
text1 is in the tree, but you'll see some output below that comes from
within the _ComponentUtils.findComponent that it is skipping a bunch
of elements.  I noticed this in _ComponentUtils.findComponent:

if (!(childOrFacet instanceof NamingContainer))
            {
                UIComponent find = findComponent(childOrFacet, id);
                if (find != null) return find;
            }
            else if (idsAreEqual(id,childOrFacet))
            {
                return childOrFacet;
            }

Which basically skips out almost everything in the tree.  Any reason
for this that I am not seeing right now?  When I replace the above
with:

UIComponent find = findComponent(childOrFacet, id);
                if (find != null) return find;

It finds it.

<UIViewRoot id="_id16" family="javax.faces.ViewRoot" locale="en"
renderKitId="HTML_BASIC" rendered="true" rendererType="NULL"
rendersChildren="false" transient="false" viewId="/inputAjax.jsp">
  <html.HtmlForm id="_id0" FORMER_CHILD_IDS="[_id6, _id1, statusDiv]"
forceIdIndex="true"
org.apache.myfaces.renderkit.html.HtmlFormRendererBase.HIDDEN_COMMAND_INPUTS_SET="[_id0:_link_hidden_]"
accept="NULL" acceptcharset="NULL" dir="NULL"
enctype="application/x-www-form-urlencoded" family="javax.faces.Form"
lang="NULL" onclick="NULL" ondblclick="NULL" onkeydown="NULL"
onkeypress="NULL" onkeyup="NULL" onmousedown="NULL" onmousemove="NULL"
onmouseout="NULL" onmouseover="NULL" onmouseup="NULL" onreset="NULL"
onsubmit="NULL" rendered="true" rendererType="javax.faces.Form"
rendersChildren="false" style="NULL" styleClass="NULL"
submitted="false" target="NULL" title="NULL" transient="false">
    <html.HtmlPanelGrid id="_id1" FORMER_CHILD_IDS="[_id3, date1,
smcb, _id4, _id2, text1]" forceIdIndex="true" bgcolor="NULL"
border="0" cellpadding="NULL" cellspacing="NULL" columnClasses="NULL"
columns="2" dir="NULL" family="javax.faces.Panel" footerClass="NULL"
frame="NULL" headerClass="NULL" lang="NULL" onclick="NULL"
ondblclick="NULL" onkeydown="NULL" onkeypress="NULL" onkeyup="NULL"
onmousedown="NULL" onmousemove="NULL" onmouseout="NULL"
onmouseover="NULL" onmouseup="NULL" rendered="true"
rendererType="javax.faces.Grid" rendersChildren="true"
rowClasses="NULL" rules="NULL" style="NULL" styleClass="NULL"
summary="NULL" title="NULL" transient="false" width="NULL">
      <html.HtmlOutputText id="_id2" forceIdIndex="true"
converter="NULL" escape="true" family="javax.faces.Output"
localValue="Input Some Text" rendered="true"
rendererType="javax.faces.Text" rendersChildren="false" style="NULL"
styleClass="NULL" title="NULL" transient="false"/>
      <org.apache.myfaces.custom.inputAjax.HtmlInputTextAjax
id="text1" forceIdIndex="true" forceId="true" accesskey="NULL"
alt="NULL" converter="NULL" dir="NULL" disabled="false"
displayValueOnly="false" displayValueOnlyStyle="NULL"
displayValueOnlyStyleClass="NULL" enabledOnUserRole="NULL"
family="javax.faces.Input" immediate="false" lang="NULL"
localValue="NULL" localValueSet="false" maxlength="-2147483648"
onFailure="NULL" onStart="NULL" onSuccess="NULL" onblur="NULL"
onchange="text1_MyFaces_inputAjax_ajaxSubmit(this, 'text1');"
onclick="NULL" ondblclick="NULL" onfocus="NULL" onkeydown="NULL"
onkeypress="NULL" onkeyup="NULL" onmousedown="NULL" onmousemove="NULL"
onmouseout="NULL" onmouseover="NULL" onmouseup="NULL" onselect="NULL"
readonly="false" rendered="true"
rendererType="org.apache.myfaces.InputTextAjax"
rendersChildren="false" required="false" setDisplayValueOnly="false"
size="-2147483648" style="NULL" styleClass="NULL"
submittedValue="NULL" tabindex="NULL" title="NULL" transient="false"
valid="true" validator="NULL" value="#{inputAjaxBean.text1}"
valueChangeListener="NULL" visibleOnUserRole="NULL"/>
      <html.HtmlOutputText id="_id3" forceIdIndex="true"
converter="NULL" escape="true" family="javax.faces.Output"
localValue="Input a Date" rendered="true"
rendererType="javax.faces.Text" rendersChildren="false" style="NULL"
styleClass="NULL" title="NULL" transient="false"/>
      <org.apache.myfaces.custom.inputAjax.HtmlInputTextAjax
id="date1" forceIdIndex="true" forceId="true" accesskey="NULL"
alt="NULL" converter="org.apache.myfaces.custom.convertDateTime.DateTimeConverter@1171e30"
dir="NULL" disabled="false" displayValueOnly="false"
displayValueOnlyStyle="NULL" displayValueOnlyStyleClass="NULL"
enabledOnUserRole="NULL" family="javax.faces.Input" immediate="false"
lang="NULL" localValue="NULL" localValueSet="false"
maxlength="-2147483648" onFailure="NULL" onStart="NULL"
onSuccess="NULL" onblur="NULL"
onchange="date1_MyFaces_inputAjax_ajaxSubmit(this, 'date1');"
onclick="NULL" ondblclick="NULL" onfocus="NULL" onkeydown="NULL"
onkeypress="NULL" onkeyup="NULL" onmousedown="NULL" onmousemove="NULL"
onmouseout="NULL" onmouseover="NULL" onmouseup="NULL" onselect="NULL"
readonly="false" rendered="true"
rendererType="org.apache.myfaces.InputTextAjax"
rendersChildren="false" required="false" setDisplayValueOnly="false"
size="-2147483648" style="NULL" styleClass="NULL"
submittedValue="NULL" tabindex="NULL" title="NULL" transient="false"
valid="true" validator="NULL" value="#{inputAjaxBean.date1}"
valueChangeListener="NULL" visibleOnUserRole="NULL"/>
      <html.HtmlOutputText id="_id4" forceIdIndex="true"
converter="NULL" escape="true" family="javax.faces.Output"
localValue="Select Some Boxes" rendered="true"
rendererType="javax.faces.Text" rendersChildren="false" style="NULL"
styleClass="NULL" title="NULL" transient="false"/>
      <org.apache.myfaces.custom.inputAjax.HtmlSelectManyCheckboxAjax
id="smcb" FORMER_CHILD_IDS="[_id5]" forceIdIndex="true"
accesskey="NULL" border="-2147483648" converter="NULL" dir="NULL"
disabled="false" disabledClass="NULL" displayValueOnly="false"
displayValueOnlyStyle="NULL" displayValueOnlyStyleClass="NULL"
enabledClass="NULL" enabledOnUserRole="NULL"
family="javax.faces.SelectMany" forceId="false" immediate="false"
lang="NULL" layout="NULL" layoutWidth="NULL" localValue="NULL"
localValueSet="false" onFailure="NULL" onStart="NULL" onSuccess="NULL"
onblur="NULL" onchange="NULL"
onclick="smcb_MyFaces_inputAjax_ajaxSubmit(this, 'smcb');"
ondblclick="NULL" onfocus="NULL" onkeydown="NULL" onkeypress="NULL"
onkeyup="NULL" onmousedown="NULL" onmousemove="NULL" onmouseout="NULL"
onmouseover="NULL" onmouseup="NULL" onselect="NULL" readonly="false"
rendered="true" rendererType="org.apache.myfaces.CheckboxAjax"
rendersChildren="false" required="false"
selectedValues="#{inputAjaxBean.chosenValues}"
setDisplayValueOnly="false" style="NULL" styleClass="NULL"
submittedValue="NULL" tabindex="NULL" title="NULL" transient="false"
valid="true" validator="NULL" value="#{inputAjaxBean.chosenValues}"
valueChangeListener="NULL" visibleOnUserRole="NULL">
        <UISelectItems id="_id5" forceIdIndex="true"
family="javax.faces.SelectItems" rendered="true" rendererType="NULL"
rendersChildren="false" transient="false"
value="#{inputAjaxBean.checkboxItems}"/>
      </org.apache.myfaces.custom.inputAjax.HtmlSelectManyCheckboxAjax>
    </html.HtmlPanelGrid>
    <org.apache.myfaces.custom.div.Div id="statusDiv"
forceIdIndex="true" forceId="true" converter="NULL"
enabledOnUserRole="NULL" family="javax.faces.Output" localValue="NULL"
rendered="true" rendererType="org.apache.myfaces.HtmlTagRenderer"
rendersChildren="false" style="NULL" styleClass="NULL"
transient="false" visibleOnUserRole="NULL"/>
    <html.HtmlCommandButton id="_id6" forceIdIndex="true"
accesskey="NULL" action="" actionListener="NULL" alt="NULL" dir="NULL"
disabled="false" family="javax.faces.Command" image="NULL"
immediate="false" lang="NULL" onblur="NULL" onchange="NULL"
onclick="NULL" ondblclick="NULL" onfocus="NULL" onkeydown="NULL"
onkeypress="NULL" onkeyup="NULL" onmousedown="NULL" onmousemove="NULL"
onmouseout="NULL" onmouseover="NULL" onmouseup="NULL" onselect="NULL"
readonly="false" rendered="true" rendererType="javax.faces.Button"
rendersChildren="false" style="NULL" styleClass="NULL" tabindex="NULL"
title="NULL" transient="false" type="submit" value="Submit"/>
  </html.HtmlForm>
  <html.HtmlOutputLink id="_id7" FORMER_CHILD_IDS="[_id8]"
forceIdIndex="true" accesskey="NULL" charset="NULL" converter="NULL"
coords="NULL" dir="NULL" family="javax.faces.Output" hreflang="NULL"
lang="NULL" localValue="inputAjax.jsf" onblur="NULL" onclick="NULL"
ondblclick="NULL" onfocus="NULL" onkeydown="NULL" onkeypress="NULL"
onkeyup="NULL" onmousedown="NULL" onmousemove="NULL" onmouseout="NULL"
onmouseover="NULL" onmouseup="NULL" rel="NULL" rendered="true"
rendererType="javax.faces.Link" rendersChildren="true" rev="NULL"
shape="NULL" style="NULL" styleClass="NULL" tabindex="NULL"
target="NULL" title="NULL" transient="false" type="NULL">
    <html.HtmlOutputText id="_id8" forceIdIndex="true"
converter="NULL" escape="true" family="javax.faces.Output"
localValue="Refresh" rendered="true" rendererType="javax.faces.Text"
rendersChildren="false" style="NULL" styleClass="NULL" title="NULL"
transient="false"/>
  </html.HtmlOutputLink>
  <org.apache.myfaces.custom.htmlTag.HtmlTag id="_id9"
forceIdIndex="true" converter="NULL" enabledOnUserRole="NULL"
family="javax.faces.Output" localValue="br" rendered="true"
rendererType="org.apache.myfaces.HtmlTagRenderer"
rendersChildren="false" style="NULL" styleClass="NULL"
transient="false" visibleOnUserRole="NULL"/>
  <html.HtmlOutputText id="_id10" forceIdIndex="true" converter="NULL"
escape="true" family="javax.faces.Output" localValue="Current chosen
values" rendered="true" rendererType="javax.faces.Text"
rendersChildren="false" style="NULL" styleClass="NULL" title="NULL"
transient="false"/>
  <org.apache.myfaces.custom.htmlTag.HtmlTag id="_id11"
forceIdIndex="true" converter="NULL" enabledOnUserRole="NULL"
family="javax.faces.Output" localValue="br" rendered="true"
rendererType="org.apache.myfaces.HtmlTagRenderer"
rendersChildren="false" style="NULL" styleClass="NULL"
transient="false" visibleOnUserRole="NULL"/>
  <html.HtmlDataTable id="_id12" FORMER_CHILD_IDS="[_id13]"
forceIdIndex="true" bgcolor="NULL" border="-2147483648"
cellpadding="NULL" cellspacing="NULL" columnClasses="NULL" dir="NULL"
family="javax.faces.Data" first="0" footer="NULL" footerClass="NULL"
frame="NULL" header="NULL" headerClass="NULL" lang="NULL"
onclick="NULL" ondblclick="NULL" onkeydown="NULL" onkeypress="NULL"
onkeyup="NULL" onmousedown="NULL" onmousemove="NULL" onmouseout="NULL"
onmouseover="NULL" onmouseup="NULL" rendered="true"
rendererType="javax.faces.Table" rendersChildren="true"
rowAvailable="false" rowClasses="NULL" rowCount="0" rowIndex="-1"
rows="0" rules="NULL" style="NULL" styleClass="NULL" summary="NULL"
title="NULL" transient="false" value="#{inputAjaxBean.chosenValues}"
var="cvalue" width="NULL">
    <UIColumn id="_id13" FORMER_CHILD_IDS="[_id15]"
forceIdIndex="true" FORMER_FACET_NAMES="[header]"
family="javax.faces.Column" footer="NULL" header="[id:_id14]"
rendered="true" rendererType="NULL" rendersChildren="false"
transient="false">
      <html.HtmlOutputText id="_id15" forceIdIndex="true"
converter="NULL" escape="true" family="javax.faces.Output"
localValue="NULL" rendered="true" rendererType="javax.faces.Text"
rendersChildren="false" style="NULL" styleClass="NULL" title="NULL"
transient="false" value="#{cvalue}"/>
      <html.HtmlOutputText id="_id14" facetName="header"
forceIdIndex="true" converter="NULL" escape="true"
family="javax.faces.Output" localValue="value" rendered="true"
rendererType="javax.faces.Text" rendersChildren="false" style="NULL"
styleClass="NULL" title="NULL" transient="false"/>
    </UIColumn>
  </html.HtmlDataTable>
</UIViewRoot>


findBase: javax.faces.component.UIViewRoot@60e277 - _id16
childorfacet: javax.faces.component.html.HtmlForm@b40443 - _id0
childorfacet: javax.faces.component.html.HtmlOutputLink@83ce25 - _id7
findBase: javax.faces.component.html.HtmlOutputLink@83ce25 - _id7
childorfacet: javax.faces.component.html.HtmlOutputText@152e9a8 - _id8
findBase: javax.faces.component.html.HtmlOutputText@152e9a8 - _id8
childorfacet: org.apache.myfaces.custom.htmlTag.HtmlTag@6a4268 - _id9
findBase: org.apache.myfaces.custom.htmlTag.HtmlTag@6a4268 - _id9
childorfacet: javax.faces.component.html.HtmlOutputText@2de41d - _id10
findBase: javax.faces.component.html.HtmlOutputText@2de41d - _id10
childorfacet: org.apache.myfaces.custom.htmlTag.HtmlTag@db4bcf - _id11
findBase: org.apache.myfaces.custom.htmlTag.HtmlTag@db4bcf - _id11
childorfacet: javax.faces.component.html.HtmlDataTable@14e1f2b - _id12
Nov 1, 2005 1:37:06 PM
org.apache.myfaces.custom.ajax.api.AjaxDecodePhaseListener beforePhase
SEVERE: Component with id [text1] not found in view tree.
Mime
View raw message