Help

After some waiting time and much promising announcements I can proudly tell that the Practical RichFaces book is published! It’s very happy moment for Max Katz and I because a lot of effort was made to make it happen. We’ve done our best to make it as much useful for JSF developers as possible, and now we believe that it doesn’t matter if you’re a novice in JSF world or skilled developer with rich expertise in various development areas – everyone should find useful parts inside.

The book completely dedicated to development with latest RichFaces 4 release and that means that it's all based on new JavaServer Faces 2. Let me briefly describe what is waiting our readers inside.

Book Content Overview

We start with describing new and most important pieces of JSF 2. It should be useful for future understanding of how the component works, and how the RichFaces extends standard JSF. We will tell not only about brand new features but also highlight most important general points for those who just starting to learn JSF 2. Good understanding of where are the core features and where the extension points should greatly help the developers with further development and troubleshooting of any kind.

Then we continue with RichFaces. Two chapters are dedicated to RichFaces core framework features and tags (a4j:). That knowledge should become a baseline for any developer who is planning to work with RichFaces 4. Because any rich component starting from simplest ones and up to most complex built according to the same basic rules and follows the same approaches that we will describe there. It's simple just to play with JSF creating pages using simple drag and drop operations in your favorite IDE. But only good knowledge of basics will make your future application really extendable and efficient. That was our main point during writing that chapter.

After the core features we will spend most of the time describing various component groups in rich: RichFaces components library. Every component section, in every group provides set of ready-to-use examples starting from very basic (using component on simple page) and to really interesting ones (like custom model for data and tree components, using server and client side components API and customization options and so on). We paid significant attention to making examples as useful as possible by making them as real-life as possible. Most of the complex samples were done according to common Web use-cases, interesting requests from RichFaces community or good questions sent to us directly. So you may think about those chapters as about a good combination of cookbook and reference guide.

A few chapters in the end will describe utility components and functions which are also included in the rich: library. We will tell (also with numerous examples) about new RichFaces validation facilities like client and object validation, components providing drag and drop functionality, and about functions and other utility tags available in RichFaces.

Penultimate chapter will describe redesigned Skins feature of RichFaces 4. Being simplified and optimized Skins become even more powerful than before allowing you add styling to the whole application in a very short time and then perform detailed customization of any depth without using any proprietary formats but relying to standard CSS enhanced with EL support.

Finally, the last chapter will show you the RichFaces Components Development Kit (CDK). Also being fully redesigned in RichFaces 4, it become really easy to use tool which allows you to create JSF 2 components of any complexity in a very short time doing most of routine work for you. This chapter demonstrates how to build a complete example of custom component written from scratch and implemented with all the RichFaces capabilities including skinning.

Full table of content and other information are available at Apress page.
All sources available at Github.

Acknowledgements

After finishing that work on the book and also looking backward to my working experience in RichFaces development I would like to extend a few special thanks to the guys without whom it would not be possible. It’s Alexander Smirnov, Nick Belaevski and Pavel Yaschenko. There were many other great developers working on that project for sure, but these three people were always the core team and great mentors and supporters for anybody who had most complex challenges in JSF world. It’s their ideas implemented now in RichFaces 4 and incorporated in JSF 2. Besides I would like to extend special thanks to Jay Balunas who helped me a lot in establishing myself as a good (as I hope :) ) JBoss community member.

It was (and will be) always easy to move forward together with you guys. So, thank you all!

So, the book is now here, and we are looking forward for your feedback! Hope it will help to make a bunch of good starts for many Java developers.


[Get updates of my blogs in twitter]

[My jroller.com blog]

9 comments:
 
07. Sep 2011, 12:58 CET | Link

Very nice work.

I've already ordered the book :)

ReplyQuote
 
07. Sep 2011, 14:59 CET | Link

Awesome work Ilya - and you are absolutely a great community member and leader!!

I have no doubt this book will help a lot of people move forward with RichFaces 4!

11. Oct 2011, 05:46 CET | Link
robert walker | rfwalker(AT)hotmail.com

hello Ilya, can we get a copy of the code snippets used throughout the book. Not the source code but the smaller examples used to show a point. I am typing it in manually and just be easier to copy and paste. I do not have the pdf but the printed book. For example, in the source code I cannot find the chapter 2 snippets (pg 28-32) on f:ajax and how its one request behind the enhanced rf4 version,

On that example, can you provide a bit more explanation why it is one request behind. I have read it a few times, typed it in, stopped in the debugger, added facestrace, just not getting it. It seems that the f:ajax submits the whole form, thereby submitting 'clock1' for

#{bean.selection}

for example, that gets added to

#{bean.renderComponents}

which f:ajax specifies should be re-rendered. so where is the breakdown in this not working? Also, and maybe related, I put a break point at the f:ajax's listener

#{bean.selectComponents}

and it never gets hit. I thought this was odd and not sure why it is not invoked when i click the button.

thanks for any help you can share on explaining a bit more

12. Oct 2011, 05:36 CET | Link
robert walker | rfwalker(AT)hotmail.com

llya, i am not sure where to post comments on the new book, but please let me know if this is not the right spot. I fixed the f:ajax listener not being invoked, but still could use an explanation what is happening when the whole ajax request updates one request behind (and code snippets would be great!)

13. Oct 2011, 03:09 CET | Link
Ilya

Sorry for being late with an answer. At first sources link present at book apress page: http://www.apress.com/9781430234494. Also you could get them from github: https://github.com/ishaikovsky/Practical-RichFaces-Book

Unfortunately need to admit that them still not available for first chapters.. Only for Rich components and CDK. (Most complex ones ;) )

About that particular case.. The explanation is pretty simple. JSF 2 when it's renders page - encodes all the ajax parameters to the page itself. So them getting sent back with next ajax request from that page and used as is. So if you trying to modify the EL expression which was used to define ajax property - it will not affect the request sent (remember previous parameters was already rendered during page rendering and just used after submit).

RichFaces evaluates parameters during current Ajax request and get's them using evaluation of component/behavior expressions. At first using that approach you can't change the way it works from the client (e.g. send wrong parameters intentionally from some browser console). Second - you could modify them during the request(e.g. define what to render according to your action results). And finally you still able to call the request from java script. But using not pure ..ajax(..) call but registering function using jsFunction tag and calling when needed.

Hope it helps!

30. Dec 2011, 17:44 CET | Link

Ilya, i can't get the chapter 12 example to work where you show how to use rich:jQuery.

I am also using this as the basis in my work project and having trouble using the rich:jQuery to use jQuery's fadeIn() instead of the javascript api show() for rich:popupPanel, i have an unaswered question on the rf forums (http://community.jboss.org/thread/176693)

here is my example from chapter 12 (running RF 4.1.0 on jboss 7) BTW: your giving me carpel tunnel me not providing these code snippets :-)

30. Dec 2011, 17:47 CET | Link
can u remove the previous post, when posted, it removed 1/2 my text


Ilya, i can't get the chapter 12 example to work where you show how to use rich:jQuery.

I am also using this as the basis in my work project and having trouble using the rich:jQuery to use jQuery's fadeIn() instead of the javascript api show() for rich:popupPanel, i have an unaswered question on the rf forums (http://community.jboss.org/thread/176693)

here is my example from chapter 12 (running RF 4.1.0 on jboss 7)
BTW: your giving me carpel tunnel me not providing these code snippets :-)

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich">
<h:head></h:head>
<h:body>
<h:form id="myForm">
   <rich:panel id="panelId" header="original header">text to change to red</rich:panel>
   <input type="button" value="update panel" id="changeButton" />
   <rich:jQuery selector="#changeButton" event="click"
          query="${'#panelId'}.css('color','red');
                 ${'#panelId .rf-p-hdr'}.text('new header');"/>

</h:form>
</h:body>
</html>

The click of the button totally ignores me, giving me the impression that query="${'#panelId'}.... is not be resolved correctly. if I use
query="alert('test');" then indeed it does show the javascript popup, so it is being
called, but i assume jQuery's selector is not finding the client id(s).

any ideas on how to fix this
 
31. Dec 2011, 00:35 CET | Link
robert
my example needs a correction to match your example, changing { to ( in the query attribute.

I still think jquery is having issues resolving selector when using the query attribute of rich:jQuery tag


corrected version

 query="$('#panelId').css('color','red');
                 $('#panelId .rf-p-hdr').text('new header');"


thanks
31. Dec 2011, 07:31 CET | Link
robert
Ilya, in your examples, i noticed you did not use formId:componentId and so on a whim, i figured since i could not get your example to work out of the book, i started trying new things and finally got the example to work. here is what is did

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich">
<h:head></h:head>
<h:body>
<h:form id="myForm">
   <rich:panel id="panelId" header="original header">
                <h:outputText id="panelTextId" value="text to change to red via jQuery" />
   </rich:panel>
   <input type="button" value="update panel" id="changeButton" />
   <rich:jQuery selector="#changeButton" event="click"
          query="jQuery('#myForm\\:panelTextId').text('new text').css('color','red');
                 jQuery('#myForm\\:panelId .rf-p-hdr').text('new header');" />

</h:form>
</h:body>
</html>

I got the above to work, i read in one of the chapter 12 tips that you may have to escape the colon character, so on a chance i tried it and it worked, i also went to the full client id myForm:panelId

When i got this to work, I thought GREAT!!, now i can get my work project to popup a rich:popupPanel , but i still can't get that to work. if you have a min, can you take a peek at http://community.jboss.org/message/643961 and see if you see something obvious in my last post
Post Comment