title: How to pass an argument to method from rendered h:outputText?
body: <p>I am displaying a table of data from an sql query and want to render a section of code based on one of the field values from this sql query.</p>
  
  <p>View: records.xthml</p>
  
  <pre><code>&lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;td&gt;#{messages['table.header.id']}&lt;/td&gt;
        &lt;td&gt;#{messages['table.header.name']}&lt;/td&gt;
        &lt;td&gt;#{messages['table.header.date.added']}&lt;/td&gt;
        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;a4j:repeat value="recordListBean.records" var="listedRecord" rowKeyVar="index"&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;h:outputText value="#{listedRecord.id}&lt;/td&gt;
          &lt;td&gt;&lt;h:outputText value="#{listedRecord.name}&lt;/td&gt;
          &lt;td&gt;
            &lt;h:outputText value="#{listedRecord.dateAdded}" rendered="#{viewRecordBean.currentRecord(listedRecord.id)}" /&gt;
            &lt;h:outputText value="#{messages['table.header.record.archived']}" rendered="!#{viewRecordBean.currentRecord(listedRecord.id)}" /&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/a4j:repeat&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Controller: ViewListBean.java</p>
  
  <pre><code>public boolean currentRecord(Long recordId) {
    Long maxRecordId = 10;
    if (recordId &lt;= maxRecordId) {
      return true;
    } else {
      return false;
    }
  }
  </code></pre>
  
  <p>The two rows of records.xhtml code in question are:</p>
  
  <pre><code>&lt;h:outputText value="#{listedRecord.candidate}" rendered="#{viewRecordBean.currentRecord(listedRecord.id)}" /&gt;
  &lt;h:outputText value="#{messages['table.header.record.archived']}" rendered="#{!viewRecordBean.currentRecord(listedRecord.id)}" /&gt;
  </code></pre>
  
  <p>I want to be able to pass an argument within the rendered check and return a boolean to render or not.  Let's say that there are 20 records returned in this sql query.  If the <code>recordId</code> value of the current row is less than or equal to 10, it will return true and the <code>listedRecord.dateAdded</code> field will be displayed.  Otherwise it will return false and the word <code>Archived</code> will be displayed.</p>
  
  <p>Is this the correct way to pass an argument from a JSF generated XHTML page to the controlling bean's method?</p>
  
  <p>Is there a better or more efficient way of doing this?</p>