I have this xhtml in which i have a p:timeline... i want to when i select an object (training pLan), show a modal dialog with the details. But i can´t get the select event to trigger... the method never gets called!
Here is my xhtml code
<fieldset class="scheduler-border">
<legend class="scheduler-border">#{msg['tp_list']}</legend>
<p:timeline id="timeline" value="#{nav.model}" height="450px" selectable="#{nav.selectable}" zoomable="# {nav.zoomable}" moveable="#{nav.moveable}" stackEvents="#{nav.stackEvents}" axisOnTop="#{nav.axisOnTop}" eventStyle="#{nav.eventStyle}" showCurrentTime="#{nav.showCurrentTime}" showNavigation="#{nav.showNavigation}">
<p:ajax event="select" listener="#{nav.onSelect}" />
</p:timeline>
</fieldset>
here is my bean:
@Named("nav")
@ViewScoped
private TimelineModel model;
private boolean selectable = true;
private boolean zoomable = true;
private boolean moveable = true;
private boolean stackEvents = true;
private String eventStyle = "box";
private boolean axisOnTop;
private boolean showCurrentTime = true;
private boolean showNavigation = false;
.
.
.
@PostConstruct
protected void initialize() {
LOGGER.info("In post-Construct INITIALIZE!");
model = new TimelineModel();
allPlans = tPlanService.getAllTPlan();
for (TrainingPlan tp : allPlans) {
LOGGER.info("IN FOR: " + tp.getEndDate());
model.add(new TimelineEvent(tp.getName(), tp.getStartDate(), tp.getEndDate()));
}
}
public void onSelect(TimelineSelectEvent e) {
LOGGER.info("In onSelect of NAV");
TimelineEvent timelineEvent = e.getTimelineEvent();
facesMessageBox.infoMessage("Selected event:", "aaaaaaaaaaaaaaaaaaaaa");
}
this method (onSelect) is never called by the ajax! :(
Showcase example did not work for me too. But adding the process attribute with the enclosing form as value to ajax tag worked for me:
<h:form id="form">
...
<p:ajax
event="select"
listener="#{nav.onSelect}"
process=":form"
/>
...
</h:form>
Please note: adding @this or the timeline identifier did not work too!