Latest News

Friday 20 April 2012

Primefaces Mobile - Weather App Example

As a Java developer, I usually get requests of building mobile apps. I like building Java application; enterprise, web and mobile. The latest projects that I have been involved with make heavy use of JSF and Primefaces in particular.

I am quite confortable with JSF and therefore I decided to build a mobile application using JSF and Primefaces Mobile. Primefaces Mobile wraps JQuery as a JSF component so that you do not have to write any Javascript. This approach has huge benefits: JQuery is a well tested framework used by large companies such as Google and Microsoft.

I will make this post quite brief. I wanted to know how easy it would be to recreate the demo from the Primefaces Mobile labs page.

Here is a screenshot of the final application running in Firefox 11 (Windows 7 64 Bit).





This was a simple example taken directly from the website therefore I was expecting to a short exercise to make build and make it run. Well not so fast.

I created a Maven based Java EE 6 project using Netbeans IDE 7.1.1. After browsing Google for a bit, I spent a few minutes getting the right repository and dependency in place.

Once the dependency where in the place, I had to create the beans required for the actual JSF page to work. I found the Primefaces Mobile backing beans on Google Code. So now I had everything setup and running. At first glance, the application seemed to running fine and working. Then I tried the application on my iPad and the Android Emulator, and nothing was working. The user interface was displayed but the "get forecast" button was not making any Ajax calls.

So I started to debug the application everytime I had some spare time. I also noticed that, while running on a desktop browser, the application would be able to an Ajax called and updated the screen with the values (see screenshot above) but you wanted to make another to find out the temparature of let's say London, the nothing would actually unless you refresh the page and try again. OK, so it's not working as expected but the example on Primefaces Mobile labs worked fine on my iPad, emulator and desktop browser (IE 9 excluded).

So I ran the application using the NetBeans debugger and decided to look through Firebug. The first call goes through and stops at the breakpoint but subsquent calls do not even get to the managed bean. Firebug shows that the other code are being retrieve from the cache. I manually set all the HTTP headers so that it does not cache any content but this is still the same result NOT WORKING!

I have uploaded the code to GitHub click on the link to download it.

In conclusion, it's not plug-and-play to make the examples on Primefaces.org labs work. The documentation for the examples are quite poor and I hope that the good folks from Primefaces can take look at my code and tell us what I am doing wrong.

A part from that, Primefaces is a good JSF framework that I use on a daily basis on multiple projects therefore I cannot really put them down but I wished the mobile examples work and tell us what is needed to make it work.

Please share your experience in the comments below or advice on how to fix it. Feel free to download the code from GitHub and have a look to.

Happy coding :)


  • Blogger Comments
  • Facebook Comments

506 comments :

  1. Thanks for this example. There are just a few examples on the web (primefaces' guide included).

    ReplyDelete
  2. Thank you for the sensible critique. Me and my neighbor were just preparing to do some research about this. We got a grab a book from our local library but I think I learned more from this post. I am very glad to see such great information being shared freely out there. http://scarprin.com/

    ReplyDelete
  3. A very informative article and lots of really honest and forthright comments made! This certainly got me thinking a lot about this issue so thanks a lot for posting! http://celabright.biz

    ReplyDelete
  4. This blog site is very good.

    ReplyDelete
  5. Thanks for taking the time to discuss this I feel strongly about it and love learning more on this topic. If possible as you gain expertise would you mind updating your blog with more information? as it is extremely helpful for me.
    Canton Fitness

    ReplyDelete
  6. Its not the case that reader must be completely agreed with author's views about article. So this is what happened with me anyways its a good effort I appreciate it. Thanks
    sell house as is

    ReplyDelete
  7. This blog is about making mobile apps. Its important because apps for mobile are getting demanded day by day. In this blog, admin said that to make mobile apps we can use Primefaces Mobile - Weather App. So I found this blog a good tutorial for learning something new..
    Web Development

    ReplyDelete
  8. Hi, Thanks a lot for such example. However i'm having serious trouble regarding look and feel. In fact, when I execute my aplication (which I literally copy from your example), it looks like a "plain" web page, i am wondering if there is some sort of css I should configurate ?

    Thanks in advance.

    ReplyDelete
  9. Forex forex and trading advice
    You should never add your money to a losing trade in the forex forex and trading market. This and more advices are found in this site. Get into it now.
    forex trading

    ReplyDelete
  10. PHP made it conceivable for element sites to exist on the Internet. With PHP it is presently conceivable to create profoundly unpredictable custom web requisitions for sites as it might be additionally utilized Custom Application Developmet window phone apps // iPhone application development // mobile app developers

    ReplyDelete
  11. This is my first time visit here. From the tons of comments on your articles,I guess I am not only one having all the enjoyment right here! weather forecast

    ReplyDelete
  12. Hello everyone, Are you into trading or just wish to give it a try, please becareful on the platform you choose to invest on and the manager you choose to manage your account because that’s where failure starts from be wise. After reading so much comment i had to give trading tips a try, I have to come to the conclusion that binary options pays massively but the masses has refused to show us the right way to earn That’s why I have to give trading tips the accolades because they have been so helpful to traders . For a free masterclass strategy kindly contact (paytondyian699@gmail.com) for a free masterclass strategy. He'll give you a free tutors on how you can earn and recover your losses in trading for free..

    ReplyDelete
  13. That is really nice to hear. thank you for the update and good luck. temperature chamber,

    ReplyDelete
  14. Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also spyfone

    ReplyDelete
  15. Interested in the weather, including the effects it may have on your home, garden and day to day activities? A personal home weather station may be just what you need. Here are the answers to seven common questions to help you understand, install and use one of these remarkable instruments. Barrackpore

    ReplyDelete
  16. Wohh just what I was looking for, regards for posting.
    รีวิวUFASLOT

    ReplyDelete
  17. As people are evolving, the homes should too. And people are giving their thoughts to the home improvement and décor. Many home products are available online and also you can buy the home improvement store from many websites. The designs and furniture can be chosen according to the wish and home space.

    ReplyDelete
  18. Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!THANKS!!!!!! mobile tracker

    ReplyDelete
  19. Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. parental control apps

    ReplyDelete
  20. I conceive you have noted some very interesting points, regards for the post.
    เล่นKingmakerบนมือถือ

    ReplyDelete
  21. Wohh just what I was looking for, regards for posting.
    ไฮโลKingmaker

    ReplyDelete
  22. We provide best services to all class of clients. สล็อตKingmaker

    ReplyDelete
  23. Photos available on your site even though producing attention rapidly some quantity submits. แนะนำเว็บบอลUfabet.

    ReplyDelete
  24. I conceive you have noted some very interesting points, regards for the post.
    ป๊อกเด้งฝากไม่มีขั้นต่ำ

    ReplyDelete
  25. I read this article. I think You put a lot of effort to create this article. I appreciate your work.เกมป๊อกเด้ง

    ReplyDelete
  26. I conceive you have noted some very interesting points, regards for the post. SlotUfabet

    ReplyDelete
  27. I will bookmark your site and take the feeds additionally Casino UFABET

    ReplyDelete
  28. This is a great web site, Good sparkling user interface and, very informative blogs. thanks. You may check our website also. ทางเข้าUFABET.

    ReplyDelete
  29. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. iPhone black friday

    ReplyDelete
  30. I will bookmark your site and take the feeds additionally เดิมพันRed Tiger

    ReplyDelete
  31. I value the article.Thanks Again. Much obliged. ทางเข้าเล่นRed Tiger

    ReplyDelete
  32. Wohh just what I was looking for, regards for posting.
    Spade gaming Slot Online

    ReplyDelete
  33. I read this article. I think You put a lot of effort to create this article. I appreciate your work. วิธีเล่นสล็อตSpadegaming .

    ReplyDelete
  34. Wohh just what I was looking for, regards for posting. หวยออนไลน์

    ReplyDelete
  35. I conceive you have noted some very interesting points, regards for the post. หวยยูฟ่าเบท

    ReplyDelete
  36. I value the article.Thanks Again. Much obliged. หวยออนไลน์UFABET

    ReplyDelete
  37. I will bookmark your site and take the feeds additionally แทงไฮโลonline

    ReplyDelete
  38. We provide best services to all class of clients.
    สมัครUFABET

    ReplyDelete
  39. I conceive you have noted some very interesting points, regards for the post. เล่นไฮโลออนไลน์

    ReplyDelete
  40. This is a great web site, Good sparkling user interface and, very informative blogs. thanks. You may check our website also.แทงไฮโล

    ReplyDelete
  41. I conceive you have noted some very interesting points, regards for the post.สล็อตออนไลน์

    ReplyDelete
  42. I read this article. I think You put a lot of effort to create this article. I appreciate your work. เว็บสล็อตออนไลน์

    ReplyDelete
  43. I conceive you have noted some very interesting points, regards for the post. แทงไฮโล

    ReplyDelete
  44. I conceive you have noted some very interesting points, regards for the post. แทงไฮโลขั้นต่ำ10บาท

    ReplyDelete
  45. Photos available on your site even though producing attention rapidly some quantity submits. เล่นสล็อตออนไลน์ขั้นต่ำ10บาท

    ReplyDelete
  46. This is a great web site, Good sparkling user interface and, very informative blogs. thanks. You may check our website also.เว็บสล็อตออนไลน์ที่ดีที่สุด

    ReplyDelete
  47. I value the article.Thanks Again. Much obliged.Roulette

    ReplyDelete
  48. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. รูเล็ต

    ReplyDelete
  49. I conceive you have noted some very interesting points, regards for the post.Roulette

    ReplyDelete
  50. Wohh just what I was looking for, regards for posting.
    ไพ่เสือมังกร

    ReplyDelete
  51. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. เกมยิงปลาออนไลน์

    ReplyDelete
  52. Photos available on your site even though producing attention rapidly some quantity submits.เล่นเกมยิงปลาออนไลน์

    ReplyDelete
  53. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. สมัครเล่นยูฟ่าเบทบนมือถือ

    ReplyDelete
  54. I went to this website, and I believe that you have a plenty of excellent information, I have saved your site to my bookmarks. เล่นเกมยิงปลาออนไลน์

    ReplyDelete
  55. I conceive you have noted some very interesting points, regards for the post. สมัครสมาชิกufabet

    ReplyDelete
  56. This is a great web site, Good sparkling user interface and, very informative blogs. thanks. You may check our website also. เกมยิงปลาฝากไม่มีขั้นต่ำ

    ReplyDelete
  57. Wohh just what I was looking for, regards for posting. เกมยิงปลา

    ReplyDelete
  58. I conceive you have noted some very interesting points, regards for the post.
    เคล็ดลับสล็อตออนไลน์

    ReplyDelete
  59. I conceive you have noted some very interesting points, regards for the post.เกมยิงปลา

    ReplyDelete
  60. I conceive you have noted some very interesting points, regards for the post. เกมยิงปลาUFABET

    ReplyDelete
  61. This is very Amazing and Very Informative Artical we get alot of Informations from this artical we really appreciate your team work keep it up and keep posting such a informative articles. บาคาร่าออนไลน์

    ReplyDelete
  62. Photos available on your site even though producing attention rapidly some quantity submits.ไฮโลออนไลน์

    ReplyDelete
  63. This is very Amazing and Very Informative Artical we get alot of Informations from this artical we really appreciate your team work keep it up and keep posting such a informative articles. บาคาร่าUFABET

    ReplyDelete
  64. I conceive you have noted some very interesting points, regards for the post. เล่นบาคาร่าขั้นต่ำ10บาท

    ReplyDelete
  65. We provide best services to all class of clients. เสือมังกรออนไลน์

    ReplyDelete
  66. I conceive you have noted some very interesting points, regards for the post. วิธีเล่นเสือมังกรออนไลน์

    ReplyDelete
  67. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. สล็อตออนไลน์ขั้นต่ำ1บาท

    ReplyDelete
  68. Wohh just what I was looking for, regards for posting.
    เดิมพันสล็อต

    ReplyDelete
  69. This is my first visit to your web We are a group of volunteers and new activities in the same specialty. Website gave us helpful data to work. เกมไพ่ป๊อกเด้งออนไลน์

    ReplyDelete
  70. I conceive you have noted some very interesting points, regards for the post.เล่นเสือมังกรเว็บไหนดี

    ReplyDelete
  71. This is a great web site, Good sparkling user interface and, very informative blogs. thanks. You may check our website also.เว็บUFACASINO

    ReplyDelete
  72. I conceive you have noted some very interesting points, regards for the post. เสือมังกรขั้นต่ำ5บาท

    ReplyDelete
  73. Photos available on your site even though producing attention rapidly some quantity submits.เสือมังกรออนไลน์

    ReplyDelete
  74. This is a great web site, Good sparkling user interface and, very informative blogs. thanks. You may check our website also. เสือมังกรออนไลน์

    ReplyDelete
  75. I conceive you have noted some very interesting points, regards for the post. เดิมพันบาคาร่าขั้นต่ำ10บาท

    ReplyDelete
  76. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work.
    เว็บพนันออนไลน์ยูฟ่าเบท
    คาสิโนUFABET
    รีวิวคาสิโนออนไลน์

    ReplyDelete
  77. Wohh just what I was looking for, regards for posting.บาคาร่ายูฟ่าเบท

    ReplyDelete
  78. I conceive you have noted some very interesting points, regards for the post.รูเล็ตขั้นต่ำ10บาท

    ReplyDelete
  79. I conceive you have noted some very interesting points, regards for the post.
    บอลพรีเมียร์ลีก

    ReplyDelete
  80. This is a good tip especially to those fresh to the blogosphere. Brief but very precise info Thank you for sharing this one. A must-read post. โปรโมชั่นยูฟ่าสล็อต

    ReplyDelete
  81. I value the article.Thanks Again. Much obliged. บาคาร่าเว็บไหนดี

    ReplyDelete
  82. I read this article. I think You put a lot of effort to create this article. I appreciate your work. เล่นบาคาร่าขั้นต่ำ10บาท

    ReplyDelete
  83. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. บาคาร่ายูฟ่าเบท

    ReplyDelete
  84. I will bookmark your site and take the feeds additionally.บาคาร่าขั้นต่ำ5บาท

    ReplyDelete
  85. Wohh just what I was looking for, regards for posting. บาคาร่า365

    ReplyDelete
  86. I read this article. I think You put a lot of effort to create this article. I appreciate your work.บาคาร่าออนไลน์

    ReplyDelete
  87. I will bookmark your site and take the feeds additionally.บาคาร่าขั้นต่ำ10บาท

    ReplyDelete
  88. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. บาคาร่าขั้นต่ำ10บาท

    ReplyDelete
  89. Photos available on your site even though producing attention rapidly some quantity submits. บาคาร่าขั้นต่ำ10บาท

    ReplyDelete
  90. We help them as much as we can. If they need assistance with research, writing, grammar, formatting or proofreading, we provide our assistance to help them build their career. สมัครสมาชิกเล่นคาสิโนยูฟ่าเบทบนมือถือ

    ReplyDelete
  91. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. สมัครสมาชิกเล่นคาสิโนยูฟ่าเบทบนมือถือ

    ReplyDelete
  92. I conceive you have noted some very interesting points, regards for the post.ทางเข้าUFABET

    ReplyDelete
  93. I conceive you have noted some very interesting points, regards for the post. เดิมพันคาสิโนยูฟ่าเบท

    ReplyDelete
  94. I unquestionably esteeming each and every piece of it and I have you bookmarked to look at new เว็บพนันยูฟ่าเบท

    ReplyDelete
  95. We help them as much as we can. If they need assistance with research, writing, grammar, formatting or proofreading, we provide our assistance to help them build their career. สมัครUFABET.

    ReplyDelete
  96. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. คาสิโนออนไลน์ฝากถอนAUTO

    ReplyDelete
  97. This is my first visit to your web We are a group of volunteers and new activities in the same specialty. Website gave us helpful data to work. สมัครUFABETฝากขั้นต่ำ100 สมัครUFABETเว็บคาสิโนออนไลน์

    ReplyDelete
  98. We help them as much as we can. If they need assistance with research, writing, grammar, formatting or proofreading, we provide our assistance to help them build their career. เว็บพนันยูฟ่าเบท

    ReplyDelete
  99. This is a great web site, Good sparkling user interface and, very informative blogs. thanks. You may check our website also. บาคาร่าออนไลน์บนมือถือ

    ReplyDelete
  100. We provide best services to all class of clients. เล่นบาคาร่า

    ReplyDelete
  101. I read this article. I think You put a lot of effort to create this article. I appreciate your work.เว็บแทงบาคาร่าออนไลน์

    ReplyDelete
  102. I will bookmark your site and take the feeds additionally. ทางเข้าufabet

    ReplyDelete
  103. I conceive you have noted some very interesting points, regards for the post. เดิมพันufabet

    ReplyDelete
  104. Wohh just what I was looking for, regards for posting. สมัครสมาชิกufabet

    ReplyDelete
  105. I conceive you have noted some very interesting points, regards for the post.UFABET

    ReplyDelete
  106. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. แนะนำเว็บUFABET

    ReplyDelete
  107. This is very Amazing and Very Informative Artical we get alot of Informations from this artical we really appreciate your team work keep it up and keep posting such a informative articles. ทางเข้าufabet.

    ReplyDelete
  108. This is a great web site, Good sparkling user interface and, very informative blogs. thanks. You may check our website also. ทางเข้าเว็บพนันUFABET

    ReplyDelete
  109. This is a great web site, Good sparkling user interface and, very informative blogs. thanks. You may check our website also. คาสิโนขั้นต่ำ5บาท

    ReplyDelete
  110. This is very Amazing and Very Informative Artical we get alot of Informations from this artical we really appreciate your team work keep it up and keep posting such a informative articles. สมัครสมาชิกยูฟ่าสล็อต UFASLOTฝากถอนAuto สล็อตออนไลน์เว็บไหนดี

    ReplyDelete
  111. Wohh just what I was looking for, regards for posting.
    คาสิโนขั้นต่ำ10บาท

    ReplyDelete
  112. We help them as much as we can. If they need assistance with research, writing, grammar, formatting or proofreading, we provide our assistance to help them build their career. คาสิโนออนไลน์บนมือถือ.

    ReplyDelete
  113. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. วิธีเข้าเล่นufabet

    ReplyDelete
  114. We help them as much as we can. If they need assistance with research, writing, grammar, formatting or proofreading, we provide our assistance to help them build their career. เว็บไซต์คาสิโนยูฟ่าเบท

    ReplyDelete
  115. I conceive you have noted some very interesting points, regards for the post. เดิมพันออนไลน์Venus Casino

    ReplyDelete
  116. I conceive you have noted some very interesting points, regards for the post. เล่นคาสิโนวีนัส

    ReplyDelete
  117. I value the article.Thanks Again. Much obliged. venus casino online

    ReplyDelete
  118. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. คาสิโนออนไลน์ที่ดีที่สุด

    ReplyDelete
  119. I conceive you have noted some very interesting points, regards for the post. ยูฟ่าเบท20บาท

    ReplyDelete
  120. However, I think the weather should be a way we can control it. คาสิโนUFABET

    ReplyDelete
  121. We provide best services to all class of clients. เล่นรูเล็ตออนไลน์

    ReplyDelete
  122. This is a wonderful blog. i hope you alway to share the best thing. ufa info

    ReplyDelete
  123. I read this article. I think You put a lot of effort to create this article. I appreciate your work. รูเล็ตขั้นต่ำ10บาท

    ReplyDelete
  124. I conceive you have noted some very interesting points, regards for the post. รูเล็ตออนไลน์บนมือถือ

    ReplyDelete
  125. Wohh just what I was looking for, regards for posting.
    เล่นรูเล็ตออนไลน์

    ReplyDelete
  126. We help them as much as we can. If they need assistance with research, writing, grammar, formatting or proofreading, we provide our assistance to help them build their career. เล่นเกมรูเล็ตบนมือถือ

    ReplyDelete
  127. I value the article.Thanks Again. Much obliged. รูเล็ตขั้นต่ำ10บาท

    ReplyDelete
  128. Photos available on your site even though producing attention rapidly some quantity submits. รูเล็ตออนไลน์บนมือถือ

    ReplyDelete

Item Reviewed: Primefaces Mobile - Weather App Example Description: Rating: 5 Reviewed By: Unknown
Scroll to Top