Displaying messagebox from backing bean

This piece of code snippet will initially hide the primefaces dialog box, then in any action from the backing bean, it will be activated and seen Back bean RequestContext context = RequestContext.getCurrentInstance(); context.execute(“PF(‘dlgBlackListVar’).show();”); View <p:dialog id=”dlgBlackList” widgetVar=”dlgBlackListVar” header=”#{msg.member_blacklist_header}” showEffect=”clip” modal=”true” visible=”false”> <h:outputText value=”#{msg.member_blacklist_content}” /> </p:dialog>

Primefaces navigating in between min and max dates

Today at work I was stuck at demonstrating all the possible years which are given by min and max date ranges in the backing bean in primefaces and jsf combo. So as default primefaces calendar component only displays just set the year range to maximize the value the way you wish <p:calendar id=”birthdate” value=”#{memberController.order.birthdate}” yearRange=”c-70:c+10″

Java collection sorting

Hi In this example I’ll be sorting out a list by using comparator and collator interfaces. Both of those allow us to sort a given collection list by a key we provide. Moreover collator will allow to sort a list by a localization if you are running a multiple language application, this will help you