Monday, 23 November 2009

ADF: popup ‘ContentDelivery’ property with value ‘lazyUncached’

I have a case in which I have a servlet who renders an image from certain database values. The servlet is called from within an ADF popup.

One of the properties of the popup is the property ‘ContentDelivery’ which default value is ‘lazy’. When this property is set to ‘lazyUncached’ the content of the popup window will be delivered fresh each time the window is shown according to the documentation.

Just what I needed!

But my experience taught me something else, the first time the image is rendered correctly as I expected but from that point on my servlet code is never called again and a cached image seems to be shown.

The work around for this error is quite simple (and obvious if you’re familiar with ADF). Just put a partial submit on the buttons or components on the page that are responsible for the changes to the image (in my case via database manipulation) and add a partial trigger to the popup to this buttons or components.

Jobs done, now when the popup is called after one of the partial submit buttons is clicked the image on the popup is rendered correctly.

Thursday, 19 November 2009

Property editors/inspectors

Ooh yeah, another tip, if you have ever have to write your own property editor (or inspector or whatever you want to name it) Java Introspection works just fine. But to write your own property editor based on JavaBeans and BeanInfo Classes that’s just a pain in the ass…. Seeing Sun’s BeanBox I had an ‘aha phenomenon’ because I had just seen something that fulfilled all my needs. So I search for the code that could just render me a property editor just like the BeanBox does. But I can now say to you ‘bad approach’. So if you ever plan to write your own property editor based on Java Introspection, just write some simple classes who render a basic property editor without using custom property editors based on java.beans.PropertyEditorSupport, and other shit….

Indeed it is ‘Quick & Dirty’ but the other way seems just to be too much work compared to the benefits it gives you…

Wednesday, 18 November 2009

ADF 11g the struggle :-)

Maybe a good opener: ‘Every technology is easy to use once you have the right knowledge’… And yes this is also the case for the Oracle ADF (11g) Framework which I’m currently using. The more I learn of this technology the more I love it, but to get at this level… man what a struggle, if I could suggest one thing to Oracle it would be: build a good knowledge base for ADF…