Timeline ajax events not working.

Community Driven Extensions Project
Post Reply
janusz88
Posts: 2
Joined: 04 Jan 2016, 16:34

04 Jan 2016, 17:04

I have a timeline component and i want to be able to use the <p:ajax> event to edit. However for some reason when I add it to the timeline they do not fire. The only event that works is select I tried also add and delete.

PF: 5.3
PE: 4.0.0

here is my component definition:

Code: Select all

   <h:form id="milestoneform" >
      <pe:timeline id="timeline" value="#{milestoneViewBacking.timeline}" widgetVar="MilestoneTimline" var="EXDBMilestone"  
           axisOnTop="true" selectable="true" style="margin-bottom: 10px;"  editable="true" showButtonNew="true"    >
                                        
         <p:ajax event="edit" listener="#{milestoneViewBacking.onEdit}" />  <!-- does not work. The event is not registered in firebug -->
        <!-- <p:ajax event="select" listener="#{milestoneViewBacking.onSelect}" />   this works -->
                                        
         <p:panelGrid styleClass="tab-grid-panel noBorders">
             <p:row>
                    <p:column style="text-align: left; color: white;">
                          <h:outputText value="#{ EXDBMilestone.milestoneTypeID}">
                     </p:column>
              </p:row>
              <p:row >
                    <p:column style="text-align: left; color: white; font-size: 8pt;">
                          <h:outputText value="#{EXDBMilestone.targetDueDate}" >
                    </p:column>
                </p:row>
              </p:panelGrid>
    </pe:timeline>
   </h:form>
My listener declarations

Code: Select all

 public void onSelect(TimelineSelectEvent e) {
        
}

 public void onEdit(TimelineModificationEvent e) {  
        // get clone of the TimelineEvent to be edited  
   selected_milestone = e.getTimelineEvent();  
}  
The 'select' event is fired I can see the response headers in firebug and the listener is invoked as expected. However for the 'edit' and others nothing happens, as in no error, no response. What am I doing wrong? :?

P.S: if any more info is required please let me know.

Thank you for your help.

janusz88
Posts: 2
Joined: 04 Jan 2016, 16:34

19 Jan 2016, 15:22

Hi,

For anyone who might have encountered the same problem, it was me in my backing bean code: The TimelineEvent i had editable parameter set to false.

I had this:

Code: Select all

 TimelineEvent event = new TimelineEvent(start,end, false, group,styleclass);
instead of this:

Code: Select all

 TimelineEvent event = new TimelineEvent(start,end, true, group,styleclass);
:oops:

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests