title: How can I get my commandButton by Id?
body: <p>I want to change my ActionListener of commandButton depending on the icon selected in advance:</p>
  
  <pre><code>        &lt;p:dialog id="dialog" header="Add Memo" widgetVar="dialogMemo" resizable="false" &gt;
          &lt;h:form&gt;
              &lt;h:panelGrid columns="2" cellpadding="5"&gt;  
                  &lt;h:outputLabel for="commentInput" value="Comment:" /&gt;  
                  &lt;p:inputTextarea id="commentInput" value="#{dashboardBean.getCurrentComment()}" rows="6" cols="25" label="commentInput"/&gt;
                  &lt;p:watermark for="commentInput" value="Enter your memo..."/&gt;  
                  &lt;h:outputLabel for="selectShare" value="Share Memo: " /&gt;  
                  &lt;p:selectBooleanCheckbox id="selectShare" /&gt; 
  
                  &lt;h:outputLabel for="choosePriority" value="Priority:" /&gt;  
                  &lt;p:selectOneMenu id="choosePriority" value="#{dashboardBean.currentPriority}" label="choosePriority"&gt;  
                      &lt;f:selectItem itemLabel="Low Priority" itemValue="1" /&gt;  
                      &lt;f:selectItem itemLabel="Medium Priority" itemValue="2" /&gt;  
                      &lt;f:selectItem itemLabel="High Priority" itemValue="3" /&gt;  
                  &lt;/p:selectOneMenu&gt;
  
                  &lt;p:commandButton id="submitDialog" icon="ui-icon-check" value="Confirm" ajax='false' type="submit" action="#{dashboardBean.getLastMemo()}"/&gt;
                  &lt;p:commandButton icon="ui-icon-close" onclick="dialogMemo.hide();" value="Cancel"/&gt;
              &lt;/h:panelGrid&gt;
          &lt;/h:form&gt;
      &lt;/p:dialog&gt;
      &lt;p:layout fullPage="true"&gt;
          &lt;p:layoutUnit id="leftPanel" position="west" size="250" header="My Memos" resizable="false" closable="false" collapsible="false"&gt;
              &lt;h:form id="form"&gt; 
                  &lt;p:commandButton id="addMemo" icon="ui-icon-plus" onclick="dialogMemo.show();" type="submit" action="#{dashboardBean.getEditControl}"/&gt;  
                  &lt;p:dashboard id="dashboardId" model="#{dashboardBean.model}" binding="#{dashboardBean.dashboard}"&gt;
                  &lt;/p:dashboard&gt;  
              &lt;/h:form&gt;
          &lt;/p:layoutUnit&gt;           
  &lt;/h:body&gt;
  </code></pre>
  
  <p>When i click to command button (id="addMemo"), i want to change actionListener to commandButton(id="submitDialog").</p>
  
  <p>I try that with:</p>
  
  <pre><code>public void getEditControl()
  {
      UIViewRoot view = _context.getViewRoot();
      CommandButton button = (CommandButton) view.findComponent("submitDialog");
  
      System.out.println("I am ID ==== [ " + button.getId() +" ]");
  
  }
  </code></pre>
  
  <p>But 'button.getId()' does't work.</p>