0

I need the action to be triggered when expanding a row only, not when collapsing it, so basically rowToggle event doesn't work for me as it executes in both expanding and collapsing events

<p:ajax event="rowToggle" listener="#{queryStudiesBean.onRowToggle}" />

I need somthing like this, but with event="rowExpansion", but no rowExpansion event exists, so how can I do this?

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
zyydoosh
  • 387
  • 2
  • 14

1 Answers1

2

You should use visibility property of the ToggleEvent:

public void onRowToggle(org.primefaces.event.ToggleEvent event) {
  if (event.getVisibility() == Visibility.VISIBLE) {
    // Row was expanded
  }
}
Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102