title: Why would adding a programmatically rendered panel break ajax beahvior for a declared Panel?
body: <p>I have the following frontend code using primefaces
      
          <br>
            </p>
  
  <pre><code>    &lt;p:panel binding="#{widgetBean.panel}"/&gt;
  
      &lt;p:panel header="Widget 2" id="declaredPanel" style="height:300px; width:300px"&gt;
          &lt;p:droppable tolerance="touch" scope="widgetDrop" activeStyleClass="ui-state-highlight" &gt;
              &lt;p:ajax listener="#{widgetBean.widgetDropped}" &gt;&lt;/p:ajax&gt;
          &lt;/p:droppable&gt;
      &lt;/p:panel&gt;
  </code></pre>
  
  <p>with this for the backend bean:</p>
  
  <pre><code>public Panel getPanel(){
      Panel p = new Panel();
      p.setHeader("test");
      p.setId("programmaticPanel");
      p.setStyle("height:300px; width:300px");
      Droppable d = new Droppable();
      d.setDatasource("availableWidgets");
      d.setTolerance("touch");
      d.setScope("widgetDrop");
      d.setActiveStyleClass("ui-state-highlight");
  
      FacesContext fc = FacesContext.getCurrentInstance();
      ExpressionFactory ef = fc.getApplication().getExpressionFactory();
      MethodExpression onDropExpr = ef.createMethodExpression(
         fc.getELContext(), "#{widgetBean.widgetDropped}", null, new Class[] {     DragDropEvent.class });
  
      AjaxBehavior ajaxBehavior = new AjaxBehavior();
      ajaxBehavior.addAjaxBehaviorListener(new AjaxBehaviorListenerImpl(onDropExpr));
  
      d.addClientBehavior("drop", ajaxBehavior);
  
      p.getChildren().add(d);
      return p;
    }
    public void widgetDropped(DragDropEvent ddEvent) {
      System.out.println("DROP EXECUTED ON SERVER");
    }
  </code></pre>
  
  <p>The weirdest thing happens. If I use both ways of rendering the Panel in the UI my ajax listener never gets called.  If I remove the Panel that uses a binding my drop listener gets executed.  On top of that I can return an just a plain jane panel with no droppable children and the declarative panel still will not fire a listener. However the opposite is not true. If I remove the declarative panel the programmticaly bound one still never fires the listener.  Really I have two problems:
  1.) rendering a programmatic panel breaks the drop listener event on the declarative Panel
  2.) In any scenario the drop listener never gets called for the programmatic Panel.</p>
  
  <p>I'm using Primefaces 3.2 and running on Glassfish 3.1.1 I would LOVE any help at this point. I've researched this problem and found others complain about issues binding ajaxbehaviors programmtically, notably: <a href="http://forum.primefaces.org/viewtopic.php?f=3&amp;t=13144" rel="nofollow">Linky link</a> This seemed to have solved the issue for some...not the case for me. Thanks!</p>