Categories

Duncan Mills

Syndicate this blog

Using ORDIMAGE in R11

At the moment there seem to be a few glitches in ORDIMAGE support with JDeveloper 11 and some traffic on the forum. Just as a hint here's a snippet using af:media to display a image stored in an OrdImage attribute. note that I've had to expand the servlet reference out (that's the W/A for the current bug. Also if you've used this in 10.1.3, note that the expression for the Mime type is slightly different (excuse the wrapping in the source value):

<af:media source="/ordDeliverMedia?appModID=TuhraServiceDataControl&
                viewObjectName=TuhraService.AllImages1&
                contentCol=Image&
                rowKey=#{bindings.AllImages1Iterator.currentRowKeyString}"
           player="windows"
           autostart="true"
           contentType="#{bindings.Image.inputValue.mimeType}"/>

The Uppercase Converter

Due to immense demand after the publication of Let Me Count the Ways (OK one person asked) I thought I'd publish the rough (and I mean it!) code here:

=> Read more!

inputText to Uppercase - let me count the ways

So, it's funny how the simplest of things can lead you off on an interesting road of discovery, particularly at 5:25pm when you just wanted to add that little feature into a screen before heading home. So last night I was adding some validation onto a form. I had a email field and decided to use the regular expression validator provided by ADF BC to manage the validation. The expression for validating email format (you know someone@somewhere.com/org/net) just happens to be one of the supplied expressions in the tool - Great Zero effort! Woops - slight problem my screen is failing, ah on closer inspection, this pre-canned expression expects the email address to contain only uppercase characters - OK I have three choices here.

  1. Change the expression to support mixed case - Yes trivial to do but....
  2. Log a bug for someone else to do the above and wait for the fix - naaa
  3. Convert the contents of the field to uppercase - That's the one!

So after a little work in Google I was surprised to see that we could actually achieve this in no less than 5 ways with the combination of ADF Faces Rich Client (R11) and ADF Business Components. Here they are:

  1. If you're using JHeadstart then that has a property on the defintion to enforce this kind of thing, and then under the covers they use JavaScript (see option 4) to do it
  2. In ADF BC using a bit of code in the setter for the field to .toUppercase() the string as it comes in - you could see how this could be made generic using a custom property in the UI Hints for that attribute and a generic Superclass. So that would be a very workable solution and would apply with any client. However, no instant feedback on the client, the uppercase version would only appear after the field had been submitted up to the model
  3. Using Styles - Ah sounds simple enough - sure enough setting contentStyle="text-transform:uppercase;" as an attribute on the <af:inputText> works just fine in terms of showing the data in upper, but it's eye candy only, the value of the field is still in mixed case when saved to the model - no good for this purpose then
  4. Using a JavaScript call and a ClientListener. This approach is detailed by Lucas Jellema over on the AMIS Blog - good stuff as usual, but it seems a messy approach to me from the re-use perspective
  5. Use a Custom Converter. This is something that Matthias Wessendorf blogged about in relation to building converters which have client side capabilities. This turned out to be just the ticket - You get instant conversion to uppercase as you tab out of the field, plus the way to enable uppercase on a field is simply to add a converter tag where needed with no need for script in the page: <f:converter converterId="StringAsUppercase"/>

There you go, I need to clean up the converter code and make it more useful to turn it into a more generic case converter supporting initcap and lower case as well, at that point I'll publish the code jar (and make the source available) so it can just be dropped into your projects.

Workshop For Weblogic 10.3 is out

Hand in hand with the WebLogic 10.3 release the new version of workshop is also available see the OTN DevTools blog for more info

Starting to Twitter

Something to do with getting an iPhone :-) Given that the next two weeks are basically vacation it probably won't be very interesting. I'll see about integrating tweats with the blog at some point.

:: Next Page >>