Anatoly
Anatoly

Reputation: 5241

pe:triStateCheckbox doesn't work with p:ajax

I'm using PF 5.1 + PF Extensions 3.0.0 + OmniFaces 1.8.1 on WAS 8.0.0.10

Trying to make the following example from here <pe:triStateCheckbox/> but listener not called when I change state of a component, neither error is given.

This is my code of JSF page:

<pe:triStateCheckbox style="vertical-align:middle;" value="#{bean.notification}">
    <p:ajax listener="#{bean.toggleNotification}"/>
</pe:triStateCheckbox>

and bean:

private int notification;

public void toggleNotification() {
    System.out.println("toggle");
}

//getters and setters

What may I doing wrong? Thank you.

Upvotes: 2

Views: 693

Answers (1)

Anatoly
Anatoly

Reputation: 5241

Ok, code in a showcase not same code in a real world. Went to github we need to specify the event name:

<pe:triStateCheckbox id="ajaxTriState" value="#{triStateCheckBoxController.value2}">
       <p:ajax event="change"
               update="growl"
               listener="#{triStateCheckBoxController.addMessage}"/>
</pe:triStateCheckbox>

Upvotes: 6

Related Questions