2 Replies Latest reply on May 7, 2010 2:40 PM by Matthew Pickell

    findComponent inside HtmlForm

    Marcelo Leiras Newbie


      I'm having problems to find components inside a HtmlForm. My code:

      <h:form id="formFind">
      <a4j:commandButton id="cbFind" value="find" actionListener="#{testForm.findButtonClicked}" />
      <rich:panel id="pnA">
       <rich:panel id="pnB">
       <h:form id="formC">
       <rich:panel id="pnD">

      public void findButtonClicked(ActionEvent event) throws Exception {
       HtmlPanel pnA = (HtmlPanel)FacesContext.getCurrentInstance().getViewRoot().findComponent("pnA");

      When i look for "formC" id, it works wright. But, if i look for "pnD", i have a Null Pointer exception, because pnA.findComponent("pnD") returns null. Why?