Posts tagged jsf
Creating a custom JSF 1.2 component – with facets, resource handling, events and listeners, valueExpression and methodExpression attributes
I occasionally create custom JavaServer Faces components. Just enough to sort of remember what the steps are, but not nearly frequently enough to quickly put a new component together. This article demonstrates the quick step approach to creating a new custom component in the old fashioned way (that means: it is not a Facelets template based or an ADF Faces 11g Declarative Component). Its primary purpose is to help me quickly retrace my steps. But perhaps it will benefit some of you as well.
The Shuffler component I will develop supports facets. It will render its facet children – one after the other. Which one is rendered first can be indicated through an attribute facetOrder (values normal, reverse and random), which is EL enabled. A shuffler-method-expression can optionally be set to provide the Shuffler with a shuffle-order-processor: the method is invoked with the list of facets to shuffle and will return it in the order in which to render the children.
The component can render with a shuffle icon that when pressed causes the children to be shuffled. The Shuffler component allows registration of Shuffle Event Listeners, custom listeners that are informed whenever the shuffle More >
(including all source code left out of the article in IOUG Collaborate 2009 Select Journal)
At the time I’m writing this, Devoxx 2008 is well into it’s second day. Day one was quite interesting, with the major announcement being the release of JavaFX 1.0 last week. Apart from that, IBM presented their RFID technology, which has been incorporated into our access badges. Day two held another major announcement: all of Java will be made modular. That means not only the SDK, but also the JRE and even the JVM. Expected release date of JDK 7: somewhere in 2010… (more…)
Rapid development of Rich JSF Web applications on top of EJB/JPA persistence (JSF on Rails – Demo 1)
Here you will find the first demo from my Devoxx 2008 presentation. It shows how you can rapidly create a rich web application based on Java Server Faces and EJB/JPA persistency using JDeveloper 11g and the ADF 11g framework. The presentation included below shows the steps one by one to create a rich web application. The JDeveloper 11g application can be downloaded as well. The end result looks something like:
it includes such features as: master detail tables with synchronization; column sort; run time column manipulation: resize, reposition and hide/show; popup with detailed context data; data driven, synchronized chart; accordion for better page real estate usage.
As I was preparing for my Devoxx presentation next Monday, I decided to look at the somewhat harder way of integrating a JPA based business tier into a JavaServer Faces web tier. The easy way – when using the ADF 11g framework in JDeveloper 11g is creating a Data Control for the Session Facade Bean. The Web Application can create data bindings for entities, entity collections and operations exposed in the Session Facade Bean that completely hide the injection or lookup details from the web tier developer. It’s the ADF responsibility to find the session bean and manage references to it.
However, if you do not use ADF, you need to establish the link between the Web Application and the JPA Business Service yourself.
The JEE 5 way of achieving this consists of a few simple steps – on top of the JPA entity definitions: (more…)
Context Sensitive Resource Bundle entries in JavaServer Faces applications – going beyond plain language, region & variant locales
We were faced by an interesting challenge: our JSF application should display boilerplate text – titles, button labels, prompt, error messages, tool tips etc, – in a context sensitive way. Not just by language, region and variant – the well known dimensions along which the standard JSF and Java mechanism works with Resource Bundles. Beyond that simple ‘locale’ sensitivity – which we also needed – we need a more specialized context dependency. Along several dimensions.
For example when a user of younger age category approaches the web application, the text presented should be (or at least could be) different from whatever we show our senior users. Also when the application is accessed in the context of a certain brand or company the text may need to be different from other brand or company contexts. And the marketing department came up with the ability to presents some text tailored to the time of year – Winter or Summer, Holiday Season or no Christmas in sight – or the day of the week – working day or weekend. Good old marketing department – if they were to rule the world….
And so we got started. How can we cater for these various context dependencies, along various mutually More >