I currently got it running in the Primefaces-Extensions-Showcase by now
and added some optional Attributes to makes it more configurable.
The "optional" caption*-Attributes are needed for my project because i am using my own translation-service
(instead of the "static" msg[]-Tag's) which can (re)load resources
at runtime, automatically check's for new languages and so on...
Also the color of the single speed-test's can be changed by setting the optional attribute.
On the jsf-side i can use it by this simple example...
Code: Select all
<!-- EXAMPLE-SOURCE-START -->
<p:growl id="growl" autoUpdate="true" showDetail="true" showSummary="true" />
<pe:speedtest id="speedtest" widgetVar="speedtest" captionDownload="Down" captionUpload="Up" captionJitter="Jit" captionPing="Pg">
<p:ajax listener="#{speedTestController.SaveResults}" process="@this" update="growl" />
</pe:speedtest>
<div class="ui-g">
<p:commandButton id="btnStart" value="Start Speedtest" icon="fa fa-tachometer" style="width:100%;" onclick="PF('speedtest').start();"/>
</div>
<!-- EXAMPLE-SOURCE-END -->
...and as bean i can now use:
Code: Select all
public void SaveResults(SpeedTestEvent speedTestEvent)
{
String msg = "PingTimeMS ='"+String.valueOf(speedTestEvent.getPingTimeMS()) + "', \n"+
"Jitter ='"+String.valueOf(speedTestEvent.getJitterTimeMS()) + "', \n" +
"SpeedMbpsDownload='"+String.valueOf(speedTestEvent.getSpeedMbpsDownload()) + "', \n" +
"SpeedMbpsUpload='"+String.valueOf(speedTestEvent.getSpeedMbpsUpload()) +"'";
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Saved your speed results:", msg);
FacesContext.getCurrentInstance().addMessage(null, message);
}
The only thing i don't get running is to build up the primefaces-extension libraries
in combination with the primefaces 6.2 SNAPSHOT
and get it running in my own application cause of multiple errors beginning on the start page
coming from javascript...
...here i need to analyze if it's a bug in Primefaces 6.2-SNAPSHOT or in my application...
If you want you can see/preview my fork of the primefaces-extensions-core at:
https://github.com/ssibitz/core
Feedback is welcome