Sunday, August 12, 2018

Primfaces Tips

  • When we want to allow only some formatted inputs we can  use mask 
     <p:inputMask  value="#{addNewPatientController.newPatient.contactNum}"  mask="9999999999"  />

  • Primefaces selectonemenu filter 
        <p:selectOneMenu id="advanced" value="#{selectOneMenuView.theme}"   filter="true"
         effect="fade" var="t" style="width:160px"   filterMatchMode="startsWith">

  •  To add progress bar on button click                                                                                                               <p:ajaxStatus onstart="PF('statusDialog').show()" onsuccess="PF('statusDialog').hide()" />                                                                                   <p:dialog widgetVar="statusDialog" modal="true" draggable="false" closable="false"   resizable="false" showHeader="false">
           <p:graphicImage value="/images/processGif.gif"   style="width: 200px;"/>    
              </p:dialog>
  • To get a drop  down  like  this   set  autoWidth  to   autoWidth ="false"                                                                     <p:selectOneMenu id="trxnType" value="#{trxnSummaryController.trxnSummary.txnCode}"      autoWidth ="false">






  • To get  numbers like  this  3, 455, 566 format  we can use                                                                   
                           <h:outputText value="#{trxnSummaryController.summaryObj.totTrxnAll}">    
                                         <f:convertNumber maxFractionDigits="0"  groupingUsed="true" />    
                                </h:outputText>                                                                                                                                                                                    
  • To get  numbers like  this  3, 455, 566.00 format  we can use          
                            <h:outputText value="#{trxnSummaryController.summaryObj.totTrxnAll}">     
                                    <f:convertNumber maxFractionDigits="2"  groupingUsed="true"  pattern="#,##0.00" />
                         </h:outputText>
  • When  adding logic , We unable to  use  '&&'   .We  can  use  'and'  instead  of   '&&' .
                         rendered="#{ (divisionDetailsVar.status != 'TERMINATED')   and   ( ! divisionDetailsVar.isWorkFlowObjActive )  }" 

Version :- 1.2.2

The AI Driven Software Developer, Optimize Innovate Transform

  The AI-Driven Software Developer: Optimize, Innovate, Transform": AI Transformation in Software Development : Understand how AI is re...