commandButton to refrsh a chart

UI Components for JSF
Post Reply
lolita
Posts: 6
Joined: 15 Aug 2014, 11:08

31 Aug 2014, 11:17

Hi

I have to refresh a line chart after i enter parameters and when i click on the commandButton
i try
commandButton with ajax = false
commandButton by default ajax = true
but it does'nt work this is my page :

Code: Select all

<html 
     xmlns="http://www.w3.org/1999/xhtml"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
    >


 <h:head>
 
 </h:head>   


<h:body>

	 <h:form id="form1">
    <p:panel id="panel" header="Paramétres">
      <h:panelGrid columns="4" cellpadding="6">
		  <p:outputLabel for="datedebut" value="Date début" />
          <p:calendar   id="datedebut" value="#{httpMB.choix.startdate}" pattern="dd/MM/yyyy HH:mm:ss" showOn="button" required="true" />
        
          <p:outputLabel for="datefin" value="Date fin" />
          <p:calendar id="datefin" value="#{httpMB.choix.endDate}" pattern="dd/MM/yyyy HH:mm:ss" showOn="button" required="true"  />
        
         <p:outputLabel for="host" value="Nom du host" />
         <h:inputText id="host" value="#{httpMB.choix.host}"  required="true" ></h:inputText>
      </h:panelGrid>
  
        <p:commandButton value="Valider" icon="ui-icon-check"    actionListener ="#{httpMB.refreshRTTChart}"  ajax="false"      update=":form1:outlineRtt"     >
        </p:commandButton>
      
       
    </p:panel>


        <p:chart type="line"   id="outlineRtt"   model="#{httpMB.dataRTT}"  widgetVar="outlineRtt"  style="height:400px;"/>
       
           
    </h:form>  
</h:body>
</html>

the method that refresh the lineChart contains the method that creates the lineChart

help please
Thanks

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

03 Sep 2014, 21:18

does httpMB.refreshRTTChart() re-populate/rebuild the chart series data structure or list? with PrimeFaces 5.0 (Final release), I recognized that there is an error/bug when you click F5 (browser refresh) on xhtml pages that contain charts, unless you rebuild the chart series data structure or list. I just learned that yesterday.

Code: Select all

        <p:commandButton value="Valider" icon="ui-icon-check"    actionListener ="#{httpMB.refreshRTTChart}"  ajax="false"      update=":form1:outlineRtt"     >
        </p:commandButton>
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 38 guests