SlideShare uma empresa Scribd logo
1 de 56
Baixar para ler offline
Çagatay Çivici
Çagatay Çivici

• JSF Expert Group Member (JSR-314, JSR-344)
• PrimeFaces Lead
• Apache MyFaces PMC
• Speaker, Author, Reviewer
• Co-Founder of Prime Teknoloji
Prime Teknoloji

• Specialized in Java EE and Agile
• Consulting
• Training
• Delivery
• Offices in Istanbul and Ankara
• www.prime.com.tr
3 Years Old
Lightweight
Easy to Use
Only 1 Jar
1.7~ mb
No Required
Dependencies
Zero Config
Who Uses?
In The Wild
Popularity
Global




Colombia
100+ UI Components
Advanced UIs
Form Components
Hide Complexity
       CSS                         JS                         AJAX



                 Keep Flexibility
 <p:tabView onTabChange=”handleTabChange()”>
   <p:ajax event=”change” listener=”#{bean.onTabChange}” update=”comp” />
      //tabs
 </p:tabView>


 CSS                   JS                Client                 Ajax
Override               API              Callbacks             Callbacks
Anatomy of a Component
Page     <p:schedule id=”sch” value=”#{bean.model}” editable=”true” />


Markup   <div id=”sch”></div>


         <script type=”text/javascript”>
Script     PrimeFaces.cw(‘Schedule’,’widgetVar’, {id:’sch’, editable:true});
         </script>
Accessibility
Keyboard/Mouse




ARIA Attributes
HTML5

                 data-*
canvas                            websockets

         forms            media
PrimeFaces Ajax


Server APIs: Standard JSF 2
Client APIs:
Ajax Extensions

                p:ajax

autoUpdate                   Callbacks

              Selectors

AjaxStatus                RequestContext

             partialSubmit
p:ajax       f:ajax
oncomplete   onevent
 onerror     onerror
  onstart
onsuccess
  async
  global
AjaxStatus
               <p:ajaxStatus>
                 <f:facet name=”start”>
                       <p:graphicImage value=”fancyanimation.gif” />
                 </f:facet>
 Declarative     <f:facet name=”complete”>
                       <h:outputText value=”Request Completed” />
                 </f:facet>
               </p:ajaxStatus>



Programmatic   <p:ajaxStatus onstart=”dialog.show()” oncomplete=”dialog.hide()” />



   Global      <p:commandButton global=”true|false” />
RequestContext - Scripts
           <p:commandButton value=”Submit” action=”#{bean.save}” />
Page
           <p:dialog widgetVar=”dialogWidget” ... />


           public void save() {
            RequestContext rc = RequestContext.getCurrentInstance();
Bean        rc.execute(“dialogWidget.hide()”);
       }
RequestContext - Update

           <p:commandButton value=”Submit” action=”#{bean.save}” />
Page
           <h:outputText id=”val” value=”#{bean.property}” />


           public void save() {
Bean        RequestContext rc = RequestContext.getCurrentInstance();
            rc.addPartialUpdateTarget(“val”);
       }


                                               or
           <p:commandButton value=”Submit” action=”#{bean.save}”
                           update=”val” />

           <h:outputText id=”val” value=”#{bean.property}” />
RequestContext - Scroll

           <p:commandButton value=”Submit” action=”#{bean.save}” />
Page
           <h:outputText id=”val” value=”#{bean.property}” />


           public void save() {
Bean        RequestContext rc = RequestContext.getCurrentInstance();
            rc.scrollTo(“val”);
       }
AutoUpdate
  <p:growl id=”messages” />

 <p:commandButton value=”Save” update=”messages” />
 <p:commandButton value=”Update” update=”messages” />
 <p:commandButton value=”Delete” update=”messages” />



                         becomes

 <p:growl id=”messages” autoUpdate=”true”/>

 <p:commandButton value=”Save” />
 <p:commandButton value=”Update” />
 <p:commandButton value=”Delete” />
PartialSubmit
                     False                                                           True
 Post                                                       Post
Data:javax.faces.partial.ajax=true&javax.faces.source=fo   Data:javax.faces.partial.ajax=true&javax.faces.source=for
rm%3Aj_idt18&javax.faces.partial.execute=form              m%3Aj_idt18&javax.faces.partial.execute=form
%3Aname&javax.faces.partial.render=form                    %3Aname&javax.faces.partial.render=form
%3Adisplay&form%3Aj_idt18=form                             %3Adisplay&form%3Aj_idt18=form
%3Aj_idt18&form=form&form%3Aname=&form                     %3Aj_idt18&form=form&form
%3Aj_idt20=&form%3Aj_idt22=&form%3Aj_idt24=&form           %3Aname=&javax.faces.ViewState=7916482521909421
%3Aj_idt26=&form%3Aj_idt28=&form%3Aj_idt30=&form           983%3A-2156051337299048496
%3Aj_idt32=&form%3Aj_idt34=&form%3Aj_idt36=&form
%3Aj_idt38=&form%3Aj_idt40=&form%3Aj_idt42=&form
%3Aj_idt44=&form%3Aj_idt46=&form%3Aj_idt48=&form
%3Aj_idt50=&form%3Aj_idt52=&form%3Aj_idt66=&form
%3Aj_idt68=&form%3Aj_idt70=&form%3Aj_idt72=&form
%3Aj_idt74=&form%3Aj_idt76=&form%3Aj_idt78=&form
%3Aj_idt80=&form%3Aj_idt82=&form%3Aj_idt84=&form
%3Aj_idt86=&form%3Aj_idt88=&form%3Aj_idt90=&form
%3Aj_idt92=&form%3Aj_idt94=&form%3Aj_idt96=&form
%3Aj_idt98=&javax.faces.ViewState=79164825219094
21983%3A-2156051337299048496
PrimeFaces Selectors (PFS)
  update=”@(form)”

  update=”@(form.first)”

  update=”@(.mystyle)”

  update=”@(.ui-datatable)”

  update=”@(:input:not(select))”

 update=”@(:input:disabled))”
ResourceHandling

                                On The Fly
         Optimizations    and    Loading




Minify      Merge    Compress
Demo
Themes
Install a Theme

    Add primefaces-{themename}.jar




                    Configure
   <context-param>
    <param-name>primefaces.THEME</param-name>
    <param-value>{themename}</param-value>
   </context-param>
Roll Your Own
Advanced Themes
Demo
PrimeFaces Mobile
PrimeFaces Mobile
 <pm:page title="TwitFaces">

        <pm:view id="main" swatch="b">
            <pm:header title="TwitFaces">
            </pm:header>

            <pm:content>
                <h:form id="twitForm">
                    <h:outputText value="Account: " />
                    <h:inputText value="#{twitterController.username}" />
                    <p:separator />
                    <p:commandButton value="Get Tweets" icon="refresh" update="tweetList"
                                      actionListener="#{twitterController.loadTweets}" />

                    <p:dataList id="tweetList" value="#{twitterController.tweets}" var="tweet">
                        #{tweet}
                    </p:dataList>
                </h:form>
            </pm:content>
        </pm:view>

    </pm:page>
PrimeFaces Mobile



         powered by
Demo
PrimeFaces Push


       WebSockets
PrimeFaces Push
                           PushServer
     JSF APP
                             (Jetty)


 1
     2         3
                                    4
                               4
               4   4   4
PrimeFaces Push

 Page           <p:push channel=”chat” onmessage=”handleMessage” />



               public void send() {
                RequestContext rc = RequestContext.getCurrentInstance();
 Bean           rc.push(“chat”, “Hello everyone!”);
           }




Callback   <script type=”text/javascript”>
             function handleMessage(event, data) {
                   //data -> “Hello everyone!”
             }
           </script>
Demo
Back to Atmosphere?
Portlets




    Sample: /svn/examples/trunk/prime-portlet
On The Cloud

     http://primefaces-rocks.appspot.com



     http://primefaces-gae-kickstart.appspot.com
Documentation



        450+ Pages
Community



            2000 posts / month
Bundled with NetBeans
Enterprise




  Support    Training   Consulting
Scaffolding
Roadmap

• Current 3.2
• Next 3.3
• Keep on 3.x
• PrimeFaces Cookbook
• De-Facto Standard
The End
           contact@prime.com.tr

               @primefaces

              206606616332

          http://blog.primefaces.org

Mais conteúdo relacionado

Mais procurados

HTML5 - The 2012 of the Web
HTML5 - The 2012 of the WebHTML5 - The 2012 of the Web
HTML5 - The 2012 of the Web
Robert Nyman
 
JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)
Roger Kitain
 
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin PagesWordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin Pages
Brandon Dove
 
2012.sandiego.wordcamp
2012.sandiego.wordcamp2012.sandiego.wordcamp
2012.sandiego.wordcamp
Brandon Dove
 
14 Fr 13 Civici Component Library Showdown
14 Fr 13 Civici Component Library Showdown14 Fr 13 Civici Component Library Showdown
14 Fr 13 Civici Component Library Showdown
cagataycivici
 

Mais procurados (20)

BPM-2 Introduction to Advanced Workflows
BPM-2 Introduction to Advanced WorkflowsBPM-2 Introduction to Advanced Workflows
BPM-2 Introduction to Advanced Workflows
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
HTML5 - The 2012 of the Web
HTML5 - The 2012 of the WebHTML5 - The 2012 of the Web
HTML5 - The 2012 of the Web
 
What's new in Rails 4
What's new in Rails 4What's new in Rails 4
What's new in Rails 4
 
BPM-3 Advanced Workflow Deep Dive
BPM-3 Advanced Workflow Deep DiveBPM-3 Advanced Workflow Deep Dive
BPM-3 Advanced Workflow Deep Dive
 
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
 
JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)
 
Vaadin Introduction, 7.3 edition
Vaadin Introduction, 7.3 editionVaadin Introduction, 7.3 edition
Vaadin Introduction, 7.3 edition
 
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin PagesWordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin Pages
 
Secure WordPress Development Practices
Secure WordPress Development PracticesSecure WordPress Development Practices
Secure WordPress Development Practices
 
Jsfandsecurity
JsfandsecurityJsfandsecurity
Jsfandsecurity
 
Building and deploying React applications
Building and deploying React applicationsBuilding and deploying React applications
Building and deploying React applications
 
Html server control - ASP. NET with c#
Html server control - ASP. NET with c#Html server control - ASP. NET with c#
Html server control - ASP. NET with c#
 
ILUG 2010 - Deploying plug-ins to the enterprise
ILUG 2010 - Deploying plug-ins to the enterpriseILUG 2010 - Deploying plug-ins to the enterprise
ILUG 2010 - Deploying plug-ins to the enterprise
 
Angular Tutorial Freshers and Experienced
Angular Tutorial Freshers and ExperiencedAngular Tutorial Freshers and Experienced
Angular Tutorial Freshers and Experienced
 
2012.sandiego.wordcamp
2012.sandiego.wordcamp2012.sandiego.wordcamp
2012.sandiego.wordcamp
 
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
 
Myfacesplanet
MyfacesplanetMyfacesplanet
Myfacesplanet
 
14 Fr 13 Civici Component Library Showdown
14 Fr 13 Civici Component Library Showdown14 Fr 13 Civici Component Library Showdown
14 Fr 13 Civici Component Library Showdown
 
Apache Click
Apache ClickApache Click
Apache Click
 

Semelhante a Primefaces Confess 2012

ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
Spiffy
 
HTML5: huh, what is it good for?
HTML5: huh, what is it good for?HTML5: huh, what is it good for?
HTML5: huh, what is it good for?
Remy Sharp
 
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMixEasy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
elliando dias
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
Chris Alfano
 

Semelhante a Primefaces Confess 2012 (20)

AnkaraJUG Kasım 2012 - PrimeFaces
AnkaraJUG Kasım 2012 - PrimeFacesAnkaraJUG Kasım 2012 - PrimeFaces
AnkaraJUG Kasım 2012 - PrimeFaces
 
Primefaces Nextgen Lju
Primefaces Nextgen LjuPrimefaces Nextgen Lju
Primefaces Nextgen Lju
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortal
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
 
JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011
 
HTML5: huh, what is it good for?
HTML5: huh, what is it good for?HTML5: huh, what is it good for?
HTML5: huh, what is it good for?
 
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
Spark IT 2011 - Simplified Web Development using Java Server Faces 2.0
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Jsf
JsfJsf
Jsf
 
Repaso rápido a los nuevos estándares web
Repaso rápido a los nuevos estándares webRepaso rápido a los nuevos estándares web
Repaso rápido a los nuevos estándares web
 
Implementation of GUI Framework part3
Implementation of GUI Framework part3Implementation of GUI Framework part3
Implementation of GUI Framework part3
 
Introduction to RichFaces
Introduction to RichFacesIntroduction to RichFaces
Introduction to RichFaces
 
RichFaces: more concepts and features
RichFaces: more concepts and featuresRichFaces: more concepts and features
RichFaces: more concepts and features
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node js
 
JSP
JSPJSP
JSP
 
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMixEasy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
Easy Enterprise Integration Patterns with Apache Camel, ActiveMQ and ServiceMix
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
 
Client-side Rendering with AngularJS
Client-side Rendering with AngularJSClient-side Rendering with AngularJS
Client-side Rendering with AngularJS
 
PrimeFaces: Next-Generation JSF Component Suite - Ian Hlavats
PrimeFaces: Next-Generation JSF Component Suite - Ian HlavatsPrimeFaces: Next-Generation JSF Component Suite - Ian Hlavats
PrimeFaces: Next-Generation JSF Component Suite - Ian Hlavats
 
Rails 6 frontend frameworks
Rails 6 frontend frameworksRails 6 frontend frameworks
Rails 6 frontend frameworks
 

Mais de cagataycivici (7)

PrimeNG - Components para la Vida Real
PrimeNG - Components para la Vida RealPrimeNG - Components para la Vida Real
PrimeNG - Components para la Vida Real
 
How to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI ComponentsHow to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI Components
 
Itsjustangular
ItsjustangularItsjustangular
Itsjustangular
 
PrimeFaces User Guide 5.0
PrimeFaces User Guide 5.0PrimeFaces User Guide 5.0
PrimeFaces User Guide 5.0
 
Open Your Source
Open Your SourceOpen Your Source
Open Your Source
 
Facelets
FaceletsFacelets
Facelets
 
Jsfsunum
JsfsunumJsfsunum
Jsfsunum
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

Primefaces Confess 2012

  • 2. Çagatay Çivici • JSF Expert Group Member (JSR-314, JSR-344) • PrimeFaces Lead • Apache MyFaces PMC • Speaker, Author, Reviewer • Co-Founder of Prime Teknoloji
  • 3. Prime Teknoloji • Specialized in Java EE and Agile • Consulting • Training • Delivery • Offices in Istanbul and Ankara • www.prime.com.tr
  • 4.
  • 18. Hide Complexity CSS JS AJAX Keep Flexibility <p:tabView onTabChange=”handleTabChange()”> <p:ajax event=”change” listener=”#{bean.onTabChange}” update=”comp” /> //tabs </p:tabView> CSS JS Client Ajax Override API Callbacks Callbacks
  • 19. Anatomy of a Component Page <p:schedule id=”sch” value=”#{bean.model}” editable=”true” /> Markup <div id=”sch”></div> <script type=”text/javascript”> Script PrimeFaces.cw(‘Schedule’,’widgetVar’, {id:’sch’, editable:true}); </script>
  • 21. HTML5 data-* canvas websockets forms media
  • 22. PrimeFaces Ajax Server APIs: Standard JSF 2 Client APIs:
  • 23. Ajax Extensions p:ajax autoUpdate Callbacks Selectors AjaxStatus RequestContext partialSubmit
  • 24. p:ajax f:ajax oncomplete onevent onerror onerror onstart onsuccess async global
  • 25. AjaxStatus <p:ajaxStatus> <f:facet name=”start”> <p:graphicImage value=”fancyanimation.gif” /> </f:facet> Declarative <f:facet name=”complete”> <h:outputText value=”Request Completed” /> </f:facet> </p:ajaxStatus> Programmatic <p:ajaxStatus onstart=”dialog.show()” oncomplete=”dialog.hide()” /> Global <p:commandButton global=”true|false” />
  • 26. RequestContext - Scripts <p:commandButton value=”Submit” action=”#{bean.save}” /> Page <p:dialog widgetVar=”dialogWidget” ... /> public void save() { RequestContext rc = RequestContext.getCurrentInstance(); Bean rc.execute(“dialogWidget.hide()”); }
  • 27. RequestContext - Update <p:commandButton value=”Submit” action=”#{bean.save}” /> Page <h:outputText id=”val” value=”#{bean.property}” /> public void save() { Bean RequestContext rc = RequestContext.getCurrentInstance(); rc.addPartialUpdateTarget(“val”); } or <p:commandButton value=”Submit” action=”#{bean.save}” update=”val” /> <h:outputText id=”val” value=”#{bean.property}” />
  • 28. RequestContext - Scroll <p:commandButton value=”Submit” action=”#{bean.save}” /> Page <h:outputText id=”val” value=”#{bean.property}” /> public void save() { Bean RequestContext rc = RequestContext.getCurrentInstance(); rc.scrollTo(“val”); }
  • 29. AutoUpdate <p:growl id=”messages” /> <p:commandButton value=”Save” update=”messages” /> <p:commandButton value=”Update” update=”messages” /> <p:commandButton value=”Delete” update=”messages” /> becomes <p:growl id=”messages” autoUpdate=”true”/> <p:commandButton value=”Save” /> <p:commandButton value=”Update” /> <p:commandButton value=”Delete” />
  • 30. PartialSubmit False True Post Post Data:javax.faces.partial.ajax=true&javax.faces.source=fo Data:javax.faces.partial.ajax=true&javax.faces.source=for rm%3Aj_idt18&javax.faces.partial.execute=form m%3Aj_idt18&javax.faces.partial.execute=form %3Aname&javax.faces.partial.render=form %3Aname&javax.faces.partial.render=form %3Adisplay&form%3Aj_idt18=form %3Adisplay&form%3Aj_idt18=form %3Aj_idt18&form=form&form%3Aname=&form %3Aj_idt18&form=form&form %3Aj_idt20=&form%3Aj_idt22=&form%3Aj_idt24=&form %3Aname=&javax.faces.ViewState=7916482521909421 %3Aj_idt26=&form%3Aj_idt28=&form%3Aj_idt30=&form 983%3A-2156051337299048496 %3Aj_idt32=&form%3Aj_idt34=&form%3Aj_idt36=&form %3Aj_idt38=&form%3Aj_idt40=&form%3Aj_idt42=&form %3Aj_idt44=&form%3Aj_idt46=&form%3Aj_idt48=&form %3Aj_idt50=&form%3Aj_idt52=&form%3Aj_idt66=&form %3Aj_idt68=&form%3Aj_idt70=&form%3Aj_idt72=&form %3Aj_idt74=&form%3Aj_idt76=&form%3Aj_idt78=&form %3Aj_idt80=&form%3Aj_idt82=&form%3Aj_idt84=&form %3Aj_idt86=&form%3Aj_idt88=&form%3Aj_idt90=&form %3Aj_idt92=&form%3Aj_idt94=&form%3Aj_idt96=&form %3Aj_idt98=&javax.faces.ViewState=79164825219094 21983%3A-2156051337299048496
  • 31. PrimeFaces Selectors (PFS) update=”@(form)” update=”@(form.first)” update=”@(.mystyle)” update=”@(.ui-datatable)” update=”@(:input:not(select))” update=”@(:input:disabled))”
  • 32. ResourceHandling On The Fly Optimizations and Loading Minify Merge Compress
  • 33. Demo
  • 35. Install a Theme Add primefaces-{themename}.jar Configure <context-param> <param-name>primefaces.THEME</param-name> <param-value>{themename}</param-value> </context-param>
  • 38. Demo
  • 40. PrimeFaces Mobile <pm:page title="TwitFaces">         <pm:view id="main" swatch="b">             <pm:header title="TwitFaces">             </pm:header>             <pm:content>                 <h:form id="twitForm">                     <h:outputText value="Account: " />                     <h:inputText value="#{twitterController.username}" />                     <p:separator />                     <p:commandButton value="Get Tweets" icon="refresh" update="tweetList"                                       actionListener="#{twitterController.loadTweets}" />                     <p:dataList id="tweetList" value="#{twitterController.tweets}" var="tweet">                         #{tweet}                     </p:dataList>                 </h:form>             </pm:content>         </pm:view>     </pm:page>
  • 41. PrimeFaces Mobile powered by
  • 42. Demo
  • 43. PrimeFaces Push WebSockets
  • 44. PrimeFaces Push PushServer JSF APP (Jetty) 1 2 3 4 4 4 4 4
  • 45. PrimeFaces Push Page <p:push channel=”chat” onmessage=”handleMessage” /> public void send() { RequestContext rc = RequestContext.getCurrentInstance(); Bean rc.push(“chat”, “Hello everyone!”); } Callback <script type=”text/javascript”> function handleMessage(event, data) { //data -> “Hello everyone!” } </script>
  • 46. Demo
  • 48. Portlets Sample: /svn/examples/trunk/prime-portlet
  • 49. On The Cloud http://primefaces-rocks.appspot.com http://primefaces-gae-kickstart.appspot.com
  • 50. Documentation 450+ Pages
  • 51. Community 2000 posts / month
  • 53. Enterprise Support Training Consulting
  • 55. Roadmap • Current 3.2 • Next 3.3 • Keep on 3.x • PrimeFaces Cookbook • De-Facto Standard
  • 56. The End contact@prime.com.tr @primefaces 206606616332 http://blog.primefaces.org