title: How to make a component readonly on a specific button click in JSF?
body: <pre><code>&lt;h:panelGroup rendered="#{spkrCatEvt.createPanel}"&gt;
      &lt;label&gt;Event Name&lt;/label&gt;
      &lt;h:selectOneMenu style="width: 250px" class="form-control" value="#{spkrCatEvt.selected.evtId}" id="speaker_eve"&gt;
          &lt;f:selectItems value="#{spkrCatEvt.eventlist}" var="sl" itemLabel="#{sl.value}" itemValue="#{sl.id}"/&gt;
      &lt;/h:selectOneMenu&gt;
      &lt;label&gt;Speaker Name&lt;/label&gt;
      &lt;h:selectOneMenu style="width: 250px" class="form-control" value="#{spkrCatEvt.selected.spkrId}" id="speaker"&gt;
          &lt;f:selectItems value="#{spkrCatEvt.speakerlist}" var="sl" itemLabel="#{sl.value}" itemValue="#{sl.id}"/&gt;
      &lt;/h:selectOneMenu&gt;
  &lt;/h:panelGroup&gt;
  </code></pre>
  
  <p>Above is the part of code written in my JSF form, which displays when I click the '<strong>ADD</strong>' button. In the same form I have also written code for table to display data like below :</p>
  
  <pre><code>&lt;table id="example" class="table table-bordered table-striped"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Speaker Name&lt;/th&gt;
              &lt;th&gt;Event Name&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
  
      &lt;tbody&gt;
          &lt;ui:repeat id="dataTbl" value="#{spkrCatEvt.items}" var="item"&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;h:outputText value="#{item.spkrName}"/&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;h:outputText value="#{item.evtName}"/&gt;&lt;/td&gt;
  
                  &lt;td&gt;
                      &lt;h:commandLink action="#{spkrCatEvt.prepareView()}" id="view" title="View"&gt;&lt;i class="fa fa-th-large"/&gt;&lt;/h:commandLink&gt;
                      &lt;h:outputText value="  "/&gt;
                      &lt;h:commandLink  action="#{spkrCatEvt.prepareEdit()}" id="edit" title="Edit"&gt;&lt;i class="fa fa-edit"&gt;&lt;/i&gt;&lt;/h:commandLink&gt;
                      &lt;h:outputText value=" "/&gt;
                      &lt;h:commandLink  action="#{spkrCatEvt.activeEdit()}" id="activate" title="Activate" rendered="#{!item.active}"&gt;&lt;i class="fa fa-check"&gt;&lt;/i&gt;&lt;/h:commandLink&gt;
                      &lt;h:commandLink  action="#{spkrCatEvt.activeEdit()}" id="deactivate" title="DeActivate" rendered="#{item.active}"&gt;&lt;i class="fa fa-times"&gt;&lt;/i&gt;&lt;/h:commandLink&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/ui:repeat&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I want to make <code>&lt;h:selectOneNenu&gt;</code> readonly which displays 'event name', when I click the update button from the table.</p>
  
  <p>I tried the same by giving rendered attribute to the element but it didn't work.</p>
  
  <p>Being a beginner in JSF, I am not getting the solution.</p>
  
  <p>I would be obliged for help.</p>