title: Primefaces RowToggle - How to differentiate between Row Expansion and Row Collapse?
body: <p>I am using Prmefaces 3.5. I use the RowToggler in a datatable. Whenever the RowToggle button is clicked, I use to do some database access operations and display a grid with the the accessed data. </p>
  
  <p>Whenever the toggle button is clicked the below listener is called, in which the operations are done</p>
  
  <pre><code>&lt;p:ajax event="rowToggle" listener="#{controller.onRowToggle}" 
  </code></pre>
  
  <p>But the problem lies in calling this method. Not only when the row is expanded, this method is called, but also when the row is collapsed. The database operations doesn't need to be done while the row is collapsed, and so this is turning out to be an expensive operation.</p>
  
  <p>Please suggest how to know if the row is expanded or collapsed, so I could do the operations conditionally?</p>