Is there any possibility to change the interval-steps while using Primefaces timeline custom

108 Views Asked by At

Is it somehow possible to set an interval for the event-object (rangechange event)?

This behaviour is shown on their website/showcase.

I know that it depends on the zoom level, but I'd like to set the interval to 15min-steps.

1

There are 1 best solutions below

1
On

You can use "<p:poll" here is an example from primefaces website

xhtml:

<div class="card">
    <h:form>
        <h1 class="p-text-center">
            <h:outputText id="txt_count" value="#{pollView.number}"/>
        </h1>

        <p:poll interval="2" listener="#{pollView.increment}" update="txt_count"/>
    </h:form>
</div>

bean:

@Named
@ViewScoped
public class PollView implements Serializable {

    private int number;

    public void increment() {
        number++;
    }

    public int getNumber() {
        return number;
    }
}